jdbm.btree
Class BPage<K,V>

java.lang.Object
  extended by jdbm.btree.BPage<K,V>
All Implemented Interfaces:
Serializer<BPage<K,V>>

public final class BPage<K,V>
extends java.lang.Object
implements Serializer<BPage<K,V>>

Page of a Btree.

The page contains a number of key-value pairs. Keys are ordered to allow dichotomic search.

If the page is a leaf page, the keys and values are user-defined and represent entries inserted by the user.

If the page is non-leaf, each key represents the greatest key in the underlying BPages and the values are recids pointing to the children BPages. The only exception is the rightmost BPage, which is considered to have an "infinite" key value, meaning that any insert will be to the left of this pseudo-key

Version:
$Id: BPage.java,v 1.6 2003/09/21 15:46:59 boisvert Exp $
Author:
Alex Boisvert

Constructor Summary
BPage()
          No-argument constructor used by serialization.
 
Method Summary
 BPage<K,V> deserialize(SerializerInput ois)
          Deserialize the content of an object from a byte array.
 BTree<K,V> getBTree()
          Return the B+Tree that is the owner of this BPage.
static byte[] readByteArray(java.io.DataInputStream in)
           
 void serialize(SerializerOutput oos, BPage<K,V> obj)
          Serialize the content of an object into a byte array.
static void writeByteArray(SerializerOutput out, byte[] buf)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BPage

public BPage()
No-argument constructor used by serialization.

Method Detail

getBTree

public BTree<K,V> getBTree()
Return the B+Tree that is the owner of this BPage.


readByteArray

public static byte[] readByteArray(java.io.DataInputStream in)
                            throws java.io.IOException
Throws:
java.io.IOException

writeByteArray

public static void writeByteArray(SerializerOutput out,
                                  byte[] buf)
                           throws java.io.IOException
Throws:
java.io.IOException

deserialize

public BPage<K,V> deserialize(SerializerInput ois)
                       throws java.io.IOException
Deserialize the content of an object from a byte array.

Specified by:
deserialize in interface Serializer<BPage<K,V>>
Parameters:
serialized - Byte array representation of the object
Returns:
deserialized object
Throws:
java.io.IOException

serialize

public void serialize(SerializerOutput oos,
                      BPage<K,V> obj)
               throws java.io.IOException
Serialize the content of an object into a byte array.

Specified by:
serialize in interface Serializer<BPage<K,V>>
Parameters:
obj - Object to serialize
oos - DataOutputStream to save object into
Throws:
java.io.IOException


Cees de Groot (C) 2000. All rights reserved http://jdbm.sourceforge.net