final class HashDirectory extends HashNode implements java.io.Externalizable
Modifier and Type | Class and Description |
---|---|
class |
HashDirectory.HDIterator
Utility class to enumerate keys/values in a HTree
|
Modifier and Type | Field and Description |
---|---|
(package private) static int |
BIT_SIZE
Number of significant bits per directory level.
|
(package private) static int |
MAX_CHILDREN
Maximum number of children in a directory.
|
(package private) static int |
MAX_DEPTH
Maximum number of levels (zero-based)
(4 * 8 bits = 32 bits, which is the size of an "int", and as
you know, hashcodes in Java are "ints")
|
(package private) static long |
serialVersionUID |
Constructor and Description |
---|
HashDirectory()
Public constructor used by serialization
|
HashDirectory(byte depth)
Construct a HashDirectory
|
Modifier and Type | Method and Description |
---|---|
(package private) java.lang.Object |
get(java.lang.Object key)
Returns the value which is associated with the given key.
|
(package private) long |
getRecid()
Get the record identifier used to load this hashtable.
|
(package private) int |
hashMask()
Calculates the hashmask of this directory.
|
(package private) boolean |
isEmpty()
Returns whether or not this directory is empty.
|
(package private) FastIterator |
keys()
Returns an enumeration of the keys contained in this
|
(package private) java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Associates the specified value with the specified key.
|
void |
readExternal(java.io.ObjectInput in)
Implement Externalizable interface
|
(package private) java.lang.Object |
remove(java.lang.Object key)
Remove the value which is associated with the given key.
|
(package private) void |
setPersistenceContext(RecordManager recman,
long recid)
Sets persistence context.
|
(package private) FastIterator |
values()
Returns an enumeration of the values contained in this
|
void |
writeExternal(java.io.ObjectOutput out)
Implement Externalizable interface
|
static final long serialVersionUID
static final int MAX_CHILDREN
static final int BIT_SIZE
static final int MAX_DEPTH
public HashDirectory()
HashDirectory(byte depth)
depth
- Depth of this directory page.void setPersistenceContext(RecordManager recman, long recid)
recman
- RecordManager which stores this directoryrecid
- Record id of this directory.long getRecid()
boolean isEmpty()
java.lang.Object get(java.lang.Object key) throws java.io.IOException
null
if there is not association for this key.key
- key whose associated value is to be returnedjava.io.IOException
java.lang.Object put(java.lang.Object key, java.lang.Object value) throws java.io.IOException
key
- key with which the specified value is to be assocated.value
- value to be associated with the specified key.null
if no association existed.java.io.IOException
java.lang.Object remove(java.lang.Object key) throws java.io.IOException
key
- key whose associated value is to be removednull
if no association existed with given key.java.io.IOException
int hashMask()
FastIterator keys() throws java.io.IOException
java.io.IOException
FastIterator values() throws java.io.IOException
java.io.IOException
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
Cees de Groot (C) 2000-2001. All rights reserved http://jdbm.sourceforge.net