MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.sms.btree
Interface BTreeNode

All Known Implementing Classes:
InternalNode, Leaf

public interface BTreeNode

Represents a node from the b-tree (either directory node or leaf).


Method Summary
 SplitInfo add(DeweyIdentifier key, LinguisticToken value, DeweyIdentifier lowKey, DeweyIdentifier highKey, LeafCarrier leafCarrier)
          Adds the given mapping to the node.
 ObjectObjectPair bulkAdd(ObjectObjectPair data, int k, double F)
          for bulk loading
 BTreeNode getBTreeNode(DeweyIdentifier key)
          Returns the internal node/ leaf that contains the key "key"
 void getFirstKeyAfter(DeweyIdentifier key, Leaf[] inLeaf, int[] atPos)
          Creates pointers to the given key or if the key is not in the tree, to the smallest key larger than the given one that is in the tree.
 void getLastKeyBefore(DeweyIdentifier key, Leaf[] inLeaf, int[] atPos)
          Creates pointers to the given key or if the key is not in the tree, to the largest key smaller than the given one that is in the tree.
 DeweyIdentifier getLowestKey()
          gets the lowest key recursively
 BTreeNode getRoot()
          To get the root of the btree this node is sitting in
 boolean isEmpty()
          Indicates if this node is empty.
 boolean isLeaf()
          Indicates if this node is a leaf.
 void queryRange(DeweyIdentifier lowKey, DeweyIdentifier highKey, BtreePushOperator results)
          Obtains all values mapped to the given key range (low and high, inclusive).
 void remove(DeweyIdentifier key, LinguisticToken value, DeweyIdentifier lowKey, DeweyIdentifier highKey)
          Removes a single instance of the key-value mapping from the node.
 void setParent(InternalNode parentNode)
          sets the parentNode.
 

Method Detail

bulkAdd

ObjectObjectPair bulkAdd(ObjectObjectPair data,
                         int k,
                         double F)
for bulk loading


getRoot

BTreeNode getRoot()
To get the root of the btree this node is sitting in

Returns:
BTreeNode - the root

isLeaf

boolean isLeaf()
Indicates if this node is a leaf.

Returns:
true if a leaf

getBTreeNode

BTreeNode getBTreeNode(DeweyIdentifier key)
Returns the internal node/ leaf that contains the key "key"

Parameters:
key -
Returns:
BTreeNode

getFirstKeyAfter

void getFirstKeyAfter(DeweyIdentifier key,
                      Leaf[] inLeaf,
                      int[] atPos)
Creates pointers to the given key or if the key is not in the tree, to the smallest key larger than the given one that is in the tree.

Parameters:
key -
inLeaf - points to the leaf where to get the key
atPos - points to the position of the key inside the leaf

getLastKeyBefore

void getLastKeyBefore(DeweyIdentifier key,
                      Leaf[] inLeaf,
                      int[] atPos)
Creates pointers to the given key or if the key is not in the tree, to the largest key smaller than the given one that is in the tree.

Parameters:
key -
inLeaf - points to the leaf where to get the key
atPos - points to the position of the key inside the leaf

queryRange

void queryRange(DeweyIdentifier lowKey,
                DeweyIdentifier highKey,
                BtreePushOperator results)
Obtains all values mapped to the given key range (low and high, inclusive). Values are delivered to the provided push operator.

Parameters:
lowKey -
highKey -
results -

add

SplitInfo add(DeweyIdentifier key,
              LinguisticToken value,
              DeweyIdentifier lowKey,
              DeweyIdentifier highKey,
              LeafCarrier leafCarrier)
Adds the given mapping to the node.

Parameters:
key -
value -
Returns:
SplitInfo if BtreeNode had to be split to keep k or k_star. else null

remove

void remove(DeweyIdentifier key,
            LinguisticToken value,
            DeweyIdentifier lowKey,
            DeweyIdentifier highKey)
Removes a single instance of the key-value mapping from the node. If the value given is equal to BTreeConstants.ALL_MAPPINGS then all mappings associated to the given key will be removed.

Parameters:
key -
lowKey -
highKey -

isEmpty

boolean isEmpty()
Indicates if this node is empty.

Returns:
true if empty

setParent

void setParent(InternalNode parentNode)
sets the parentNode.

Parameters:
parentNode -

getLowestKey

DeweyIdentifier getLowestKey()
gets the lowest key recursively

Returns:
the smallest key

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich