ostore.dataobj
Class KeyedSelection

java.lang.Object
  |
  +--ostore.dataobj.KeyedSelection
All Implemented Interfaces:
QuickSerializable, Selection

public class KeyedSelection
extends Object
implements Selection

A Selection from an indexed btree.

Version:
$Id: KeyedSelection.java,v 1.15 2002/07/21 20:57:34 srhea Exp $
Author:
Dennis Geels

Constructor Summary
KeyedSelection(BtreeKey key, Selection sub)
          Creates a KeyedSelection
KeyedSelection(InputBuffer buffer)
          Creates a KeyedSelection from its QuickSerializable form.
 
Method Summary
 boolean before(KeyedSelection ks)
          Checks for ordering and separability with another KeyedSelection.
 boolean contains(Selection sel)
          Tests for inclusion with other Selection.
 boolean equals(Object obj)
           
 BtreeKey getKey()
          The key which selects a subtree from the top-level btree.
 Selection getSelection()
          The desired Selection of the subtree.
 int hashCode()
           
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyedSelection

public KeyedSelection(BtreeKey key,
                      Selection sub)
Creates a KeyedSelection

Parameters:
key - selects a subtree from the top-level btree
sub - selects a portion of the subtree

KeyedSelection

public KeyedSelection(InputBuffer buffer)
               throws QSException
Creates a KeyedSelection from its QuickSerializable form.

Method Detail

getKey

public BtreeKey getKey()
The key which selects a subtree from the top-level btree.


getSelection

public Selection getSelection()
The desired Selection of the subtree.


equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

contains

public boolean contains(Selection sel)
Description copied from interface: Selection
Tests for inclusion with other Selection. Iff a.contains(b) and b.contains(a), it should also be true that a.equals(b).

Specified by:
contains in interface Selection
Parameters:
sel - Another Selection.
Returns:
true iff this Selection describes a portion of a DataObject which includes the entire portion described by sel (independent of a specific DataObject).

before

public boolean before(KeyedSelection ks)
Checks for ordering and separability with another KeyedSelection. This method is used in CompositeSelection integrity checks.

Parameters:
ks - The other KeyedSelection to compare.
Returns:
true iff this KeyedSelection's key is strictly less than the other's key.

serialize

public void serialize(OutputBuffer buffer)
Description copied from interface: QuickSerializable
Add the object to the buffer.

Specified by:
serialize in interface QuickSerializable
Parameters:
buffer - the output buffer to add the object to