org.helidb.util.bplus
Class AbstractBPlusTreeNode<K,V>

java.lang.Object
  extended by org.helidb.util.bplus.AbstractBPlusTreeNode<K,V>
Type Parameters:
K - The type of keys in the node.
V - The type of values in the node.
All Implemented Interfaces:
BPlusTreeNode<K,V>
Direct Known Subclasses:
BPlusTreeLeafNode, BPlusTreeNonLeafNode

public abstract class AbstractBPlusTreeNode<K,V>
extends Object
implements BPlusTreeNode<K,V>

Abstract base class that can be used as a starting point for implementing the BPlusTreeNode interface.

Since:
1.0
Author:
Karl Gustafsson
In_jar:
helidb-core

Constructor Summary
protected AbstractBPlusTreeNode(long position, List<KeyAndValue<K,V>> records, boolean root, boolean full)
          Constructor.
 
Method Summary
 long getPosition()
          Get the position of the node in the backing storage.
 List<KeyAndValue<K,V>> getRecords()
          Get the records of this node.
 boolean isFull()
          Is this node full?
 boolean isRoot()
          Is this the tree's root node?
 void setFull(boolean b)
          Set the flag signaling that this node is full.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.helidb.util.bplus.BPlusTreeNode
isLeafNode
 

Constructor Detail

AbstractBPlusTreeNode

protected AbstractBPlusTreeNode(long position,
                                List<KeyAndValue<K,V>> records,
                                boolean root,
                                boolean full)
Constructor.

Parameters:
position - The node's position.
records - The records in the node.
root - true if the node is the root node of a tree.
full - true if the node is full.
Method Detail

getPosition

public long getPosition()
Description copied from interface: BPlusTreeNode
Get the position of the node in the backing storage.

Specified by:
getPosition in interface BPlusTreeNode<K,V>
Returns:
The position of the node in the backing storage.

getRecords

public List<KeyAndValue<K,V>> getRecords()
Description copied from interface: BPlusTreeNode
Get the records of this node. If the node is a leaf node, the records are keys and values. If it is a non-leaf node, the records are keys and pointers to child nodes.

Specified by:
getRecords in interface BPlusTreeNode<K,V>
Returns:
The node's records.

isFull

public boolean isFull()
Description copied from interface: BPlusTreeNode
Is this node full?

Specified by:
isFull in interface BPlusTreeNode<K,V>
Returns:
true if the node is full.
See Also:
BPlusTreeNode.setFull(boolean)

setFull

public void setFull(boolean b)
Description copied from interface: BPlusTreeNode
Set the flag signaling that this node is full.

Specified by:
setFull in interface BPlusTreeNode<K,V>
Parameters:
b - true if the node is full.
See Also:
BPlusTreeNode.isFull()

isRoot

public boolean isRoot()
Description copied from interface: BPlusTreeNode
Is this the tree's root node?

Specified by:
isRoot in interface BPlusTreeNode<K,V>
Returns:
true if the node is the root node of a tree.