|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgoodsjpi.Persistent
goodslib.Htree
H-Tree: combination of tree and hash table
Field Summary |
Fields inherited from class goodsjpi.Persistent |
defaultMetaobject, metaobject |
Constructor Summary | |
Htree()
Constructs a new, empty Htree with the default hash size (1000003) and default page size (128) |
|
Htree(int hashSize)
Constructs a new, empty Htree with the specified hash size and default page size (128) |
|
Htree(int hashSize,
int pageBits)
Constructs a new, empty Htree with the specified size and logarithm of page size (number of bits from the key used as page index) |
Method Summary | |
void |
clear()
Clears this Htree so that it contains no keys. |
Persistent |
get(java.lang.Object key)
Returns the value to which the specified key is mapped in this Htree |
Persistent |
put(Persistent key,
Persistent value)
Maps the specified key to the specified
value in this Htree. |
Persistent |
put(java.lang.String key,
Persistent value)
Associate object with string key. |
Persistent |
remove(java.lang.Object key)
Removes the key (and its corresponding value) from this Htree. |
int |
size()
Returns the number of keys in this Htree. |
Methods inherited from class goodsjpi.Persistent |
attachToStorage, clone, clusterWith, finalize, getDatabase, getOid, getStorageId, hashCode, onLoad |
Methods inherited from class java.lang.Object |
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Htree(int hashSize, int pageBits)
hashSize
- hash key dividerpageBits
- logarithm of page sizepublic Htree(int hashSize)
hashSize
- hash key dividerpublic Htree()
Method Detail |
public int size()
public Persistent get(java.lang.Object key)
key
- a key in the Htree.
null
if the key is not mapped to any value in
this Htree.public Persistent put(Persistent key, Persistent value)
key
to the specified
value
in this Htree. Neither the key nor the
value can be null
.
The value can be retrieved by calling the get
method
with a key that is equal to the original key.
key
- the Htree key.value
- the value.
null
if it did not have one.public Persistent put(java.lang.String key, Persistent value)
public Persistent remove(java.lang.Object key)
key
- the key that needs to be removed.
null
if the key did not have a mapping.public void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |