final class HashBucket extends HashNode implements java.io.Externalizable
hashCode()
. Leaf buckets stand at the
bottom of an H*tree because the hashing algorithm cannot further
discriminate between different keys based on their hash code.Modifier and Type | Field and Description |
---|---|
static int |
OVERFLOW_SIZE
The maximum number of elements (key, value) a non-leaf bucket
can contain.
|
(package private) static long |
serialVersionUID |
Constructor and Description |
---|
HashBucket()
Public constructor for serialization.
|
HashBucket(int level)
Construct a bucket with a given depth level.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
addElement(java.lang.Object key,
java.lang.Object value)
Add an element (key, value) to this bucket.
|
int |
getElementCount()
Returns the number of elements contained in this bucket.
|
(package private) java.util.ArrayList |
getKeys()
Obtain keys contained in this buckets.
|
java.lang.Object |
getValue(java.lang.Object key)
Returns the value associated with a given key.
|
(package private) java.util.ArrayList |
getValues()
Obtain values contained in this buckets.
|
boolean |
hasRoom()
Returns true if bucket can accept at least one more element.
|
boolean |
isLeaf()
Returns whether or not this bucket is a "leaf bucket".
|
void |
readExternal(java.io.ObjectInput in)
Implement Externalizable interface.
|
java.lang.Object |
removeElement(java.lang.Object key)
Remove an element, given a specific key.
|
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput out)
Implement Externalizable interface.
|
static final long serialVersionUID
public static final int OVERFLOW_SIZE
public HashBucket()
public HashBucket(int level)
HashDirectory
above this bucket.public int getElementCount()
public boolean isLeaf()
public boolean hasRoom()
public java.lang.Object addElement(java.lang.Object key, java.lang.Object value)
null
if no association existed.public java.lang.Object removeElement(java.lang.Object key)
key
- Key of the element to removenull
if not foundpublic java.lang.Object getValue(java.lang.Object key)
null
.java.util.ArrayList getKeys()
getValues()
.
As an optimization, the Vector returned is the instance member
of this class. Please don't modify outside the scope of this class.java.util.ArrayList getValues()
getKeys()
.
As an optimization, the Vector returned is the instance member
of this class. Please don't modify outside the scope of this class.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public java.lang.String toString()
toString
in class java.lang.Object
Cees de Groot (C) 2000-2001. All rights reserved http://jdbm.sourceforge.net