MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.sms.btree
Class InternalNode

java.lang.Object
  extended by ch.ethz.mxquery.sms.btree.InternalNode
All Implemented Interfaces:
BTreeNode

public class InternalNode
extends java.lang.Object
implements BTreeNode

Represents a b-tree directory node.


Field Summary
 boolean isOffsetNode
           
 
Constructor Summary
InternalNode(BTreeNode leftChild, DeweyIdentifier pivot, BTreeNode rightChild, int k)
           
InternalNode(int k)
           
InternalNode(int k, InternalNodeArrayMap entries)
          Constructors for the Internal Node
InternalNode(int k, InternalNodeArrayMap entries, InternalNode parent)
           
 
Method Summary
 SplitInfo add(DeweyIdentifier key, LinguisticToken value, DeweyIdentifier lowKey, DeweyIdentifier highKey, LeafCarrier leafCarrier)
          Add (generally updates) is not supported in the BTree
 ObjectObjectPair bulkAdd(ObjectObjectPair data, int k, double F)
          adds a data pair (key,BTreeNode) if the internal node is full, create new internal node and return value and internal node else insert key into internal node
 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 isFull()
           
 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)
          Remove (generally updates) is not supported in the BTree
 void setParent(InternalNode parentNode)
          sets the parentNode.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isOffsetNode

public boolean isOffsetNode
Constructor Detail

InternalNode

public InternalNode(int k,
                    InternalNodeArrayMap entries)
Constructors for the Internal Node


InternalNode

public InternalNode(int k,
                    InternalNodeArrayMap entries,
                    InternalNode parent)

InternalNode

public InternalNode(BTreeNode leftChild,
                    DeweyIdentifier pivot,
                    BTreeNode rightChild,
                    int k)

InternalNode

public InternalNode(int k)
Method Detail

add

public SplitInfo add(DeweyIdentifier key,
                     LinguisticToken value,
                     DeweyIdentifier lowKey,
                     DeweyIdentifier highKey,
                     LeafCarrier leafCarrier)
Add (generally updates) is not supported in the BTree

Specified by:
add in interface BTreeNode
Returns:
SplitInfo if BtreeNode had to be split to keep k or k_star. else null

remove

public void remove(DeweyIdentifier key,
                   LinguisticToken value,
                   DeweyIdentifier lowKey,
                   DeweyIdentifier highKey)
Remove (generally updates) is not supported in the BTree

Specified by:
remove in interface BTreeNode

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

queryRange

public void queryRange(DeweyIdentifier lowKey,
                       DeweyIdentifier highKey,
                       BtreePushOperator results)
Obtains all values mapped to the given key range (low and high, inclusive)

Specified by:
queryRange in interface BTreeNode
Parameters:
lowKey -
highKey -
results -

isLeaf

public boolean isLeaf()
Description copied from interface: BTreeNode
Indicates if this node is a leaf.

Specified by:
isLeaf in interface BTreeNode
Returns:
true if a leaf

isEmpty

public boolean isEmpty()
Description copied from interface: BTreeNode
Indicates if this node is empty.

Specified by:
isEmpty in interface BTreeNode
Returns:
true if empty

bulkAdd

public ObjectObjectPair bulkAdd(ObjectObjectPair data,
                                int k,
                                double F)
adds a data pair (key,BTreeNode) if the internal node is full, create new internal node and return value and internal node else insert key into internal node

Specified by:
bulkAdd in interface BTreeNode

getRoot

public BTreeNode getRoot()
Description copied from interface: BTreeNode
To get the root of the btree this node is sitting in

Specified by:
getRoot in interface BTreeNode
Returns:
BTreeNode - the root

setParent

public void setParent(InternalNode parentNode)
Description copied from interface: BTreeNode
sets the parentNode.

Specified by:
setParent in interface BTreeNode

getLowestKey

public DeweyIdentifier getLowestKey()
Description copied from interface: BTreeNode
gets the lowest key recursively

Specified by:
getLowestKey in interface BTreeNode
Returns:
the smallest key

isFull

public boolean isFull()

getBTreeNode

public BTreeNode getBTreeNode(DeweyIdentifier key)
Description copied from interface: BTreeNode
Returns the internal node/ leaf that contains the key "key"

Specified by:
getBTreeNode in interface BTreeNode
Returns:
BTreeNode

getFirstKeyAfter

public void getFirstKeyAfter(DeweyIdentifier key,
                             Leaf[] inLeaf,
                             int[] atPos)
Description copied from interface: BTreeNode
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.

Specified by:
getFirstKeyAfter in interface BTreeNode
inLeaf - points to the leaf where to get the key
atPos - points to the position of the key inside the leaf

getLastKeyBefore

public void getLastKeyBefore(DeweyIdentifier key,
                             Leaf[] inLeaf,
                             int[] atPos)
Description copied from interface: BTreeNode
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.

Specified by:
getLastKeyBefore in interface BTreeNode
inLeaf - points to the leaf where to get the key
atPos - points to the position of the key inside the leaf

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich