MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.sms.btree
Class Leaf

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

public class Leaf
extends java.lang.Object
implements BTreeNode

Represents a b-tree leaf node.


Constructor Summary
Leaf(int k_star)
           
Leaf(int k_star, LeafArrayMap entries)
           
Leaf(int k_star, LeafArrayMap 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,value) if the leaf is full, create new leaf and return value and leaf else insert value into leaf
 BTreeNode get(DeweyIdentifier key)
           
 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.
 DeweyIdentifier getHighestKey()
           
 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
 Leaf getNextLeaf()
           
 Leaf getPrevLeaf()
           
 BTreeNode getRoot()
          To get the root of the btree this node is sitting in
 boolean isEmpty()
          Indicates if this node is empty.
 boolean isEqual(Leaf leaf)
           
 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 removeValue(LinguisticToken value)
           
 void setNextLeaf(Leaf nextLeaf)
           
 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
 

Constructor Detail

Leaf

public Leaf(int k_star,
            LeafArrayMap entries)

Leaf

public Leaf(int k_star,
            LeafArrayMap entries,
            InternalNode parent)

Leaf

public Leaf(int k_star)
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

get

public BTreeNode get(DeweyIdentifier key)

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

removeValue

public void removeValue(LinguisticToken value)

bulkAdd

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

Specified by:
bulkAdd in interface BTreeNode
Parameters:
data -
k -
F -
Returns:
the split leaf

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

getHighestKey

public DeweyIdentifier getHighestKey()

setNextLeaf

public void setNextLeaf(Leaf nextLeaf)

getNextLeaf

public Leaf getNextLeaf()

getPrevLeaf

public Leaf getPrevLeaf()

isEqual

public boolean isEqual(Leaf leaf)

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

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

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich