com.ibm.di.btree
Class DBNode

java.lang.Object
  extended by com.ibm.di.btree.DBNode
All Implemented Interfaces:
Serializable

public class DBNode
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
static int M
           
 
Constructor Summary
DBNode()
           
 
Method Summary
 int containsKey(Object p1)
          containsKey returns true if a key is found in this node.
 DBNode delete(DBFile db, Object key)
          delete data entry
 Object findMin(DBFile db)
          find smallest key in branch
 DBNode findNode(DBFile db, Object key)
          findNode returns the nearest node for a key.
 long getDBOffset()
           
 Object getKey(int pos)
           
 DBNode getLeft(DBFile db)
           
 DBNode getNode(DBFile db, int p1)
          Returns a DBNode from the pointer in index p1
 long getPointer(int pos)
           
 DBNode getRight(DBFile db)
           
 DBNode insert(DBFile db, Object key, Object value)
          insertNode inserts a new data node and returns a new node if one was split.
 int keyCount()
           
 void logmsg(String msg)
           
 Object readLeaf(DBFile db, Object key)
          readLeaf returns the object pointed to by key
 void removeMin(DBFile db, Object key)
          remove smallest key in branch
 void replace(DBFile db, Object key, Object value)
          insertNode replaces an existing data node.
 void setDBOffset(long offset)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

M

public static final int M
See Also:
Constant Field Values
Constructor Detail

DBNode

public DBNode()
Method Detail

logmsg

public void logmsg(String msg)

setDBOffset

public void setDBOffset(long offset)

getDBOffset

public long getDBOffset()

containsKey

public int containsKey(Object p1)
containsKey returns true if a key is found in this node.


readLeaf

public Object readLeaf(DBFile db,
                       Object key)
                throws Exception
readLeaf returns the object pointed to by key

Throws:
Exception

findNode

public DBNode findNode(DBFile db,
                       Object key)
                throws Exception
findNode returns the nearest node for a key.

Throws:
Exception

findMin

public Object findMin(DBFile db)
               throws Exception
find smallest key in branch

Throws:
Exception

removeMin

public void removeMin(DBFile db,
                      Object key)
               throws Exception
remove smallest key in branch

Throws:
Exception

delete

public DBNode delete(DBFile db,
                     Object key)
              throws Exception
delete data entry

Throws:
Exception

getNode

public DBNode getNode(DBFile db,
                      int p1)
               throws Exception
Returns a DBNode from the pointer in index p1

Throws:
Exception

insert

public DBNode insert(DBFile db,
                     Object key,
                     Object value)
              throws Exception
insertNode inserts a new data node and returns a new node if one was split.

Throws:
Exception

replace

public void replace(DBFile db,
                    Object key,
                    Object value)
             throws Exception
insertNode replaces an existing data node.

Throws:
Exception

keyCount

public int keyCount()

getKey

public Object getKey(int pos)

getPointer

public long getPointer(int pos)

getLeft

public DBNode getLeft(DBFile db)
               throws Exception
Throws:
Exception

getRight

public DBNode getRight(DBFile db)
                throws Exception
Throws:
Exception

toString

public String toString()
Overrides:
toString in class Object