jdbm.htree
Class HTree

java.lang.Object
  extended byjdbm.htree.HTree

public class HTree
extends java.lang.Object

Persistent hashtable implementation for PageManager. Implemented as an H*Tree structure. WARNING! If this instance is used in a transactional context, it *must* be discarded after a rollback.

Version:
$Id: HTree.java,v 1.2 2003/03/21 02:54:58 boisvert Exp $
Author:
Alex Boisvert

Method Summary
static HTree createInstance(RecordManager recman)
          Create a persistent hashtable.
 java.lang.Object get(java.lang.Object key)
          Returns the value which is associated with the given key.
 long getRecid()
          Get the record identifier used to load this hashtable.
 FastIterator keys()
          Returns an enumeration of the keys contained in this
static HTree load(RecordManager recman, long root_recid)
          Load a persistent hashtable
 void put(java.lang.Object key, java.lang.Object value)
          Associates the specified value with the specified key.
 void remove(java.lang.Object key)
          Remove the value which is associated with the given key.
 FastIterator values()
          Returns an enumeration of the values contained in this
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createInstance

public static HTree createInstance(RecordManager recman)
                            throws java.io.IOException
Create a persistent hashtable.

Parameters:
recman - Record manager used for persistence.
Throws:
java.io.IOException

load

public static HTree load(RecordManager recman,
                         long root_recid)
                  throws java.io.IOException
Load a persistent hashtable

Throws:
java.io.IOException

put

public void put(java.lang.Object key,
                java.lang.Object value)
         throws java.io.IOException
Associates the specified value with the specified key.

Throws:
java.io.IOException

get

public java.lang.Object get(java.lang.Object key)
                     throws java.io.IOException
Returns the value which is associated with the given key. Returns null if there is not association for this key.

Throws:
java.io.IOException

remove

public void remove(java.lang.Object key)
            throws java.io.IOException
Remove the value which is associated with the given key. If the key does not exist, this method simply ignores the operation.

Throws:
java.io.IOException

keys

public FastIterator keys()
                  throws java.io.IOException
Returns an enumeration of the keys contained in this

Throws:
java.io.IOException

values

public FastIterator values()
                    throws java.io.IOException
Returns an enumeration of the values contained in this

Throws:
java.io.IOException

getRecid

public long getRecid()
Get the record identifier used to load this hashtable.



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