|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.util.hash.ASet
org.basex.util.hash.TokenSet
org.basex.util.hash.TokenIntMap
public final class TokenIntMap
This is an efficient and memory-saving hash map for storing tokens and integers.
Field Summary |
---|
Fields inherited from class org.basex.util.hash.TokenSet |
---|
keys |
Fields inherited from class org.basex.util.hash.ASet |
---|
bucket, next, size |
Constructor Summary | |
---|---|
TokenIntMap()
Constructor. |
|
TokenIntMap(DataInput in)
Constructor. |
Method Summary | |
---|---|
int |
get(byte[] key)
Returns the value for the specified key. |
void |
put(byte[] key,
int value)
Indexes the specified key and stores the associated value. |
void |
read(DataInput in)
Reads the data structure from the specified input. |
protected void |
rehash(int s)
Rehashes all entries. |
void |
write(DataOutput out)
Writes the data structure to the specified output. |
Methods inherited from class org.basex.util.hash.TokenSet |
---|
add, add, clear, contains, delete, hash, id, iterator, key, put, toString |
Methods inherited from class org.basex.util.hash.ASet |
---|
checkSize, isEmpty, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TokenIntMap()
public TokenIntMap(DataInput in) throws java.io.IOException
in
- input stream
java.io.IOException
- I/O exceptionMethod Detail |
---|
public void read(DataInput in) throws java.io.IOException
TokenSet
read
in class TokenSet
in
- input stream
java.io.IOException
- I/O exceptionpublic void write(DataOutput out) throws java.io.IOException
TokenSet
write
in class TokenSet
out
- output stream
java.io.IOException
- I/O exceptionpublic void put(byte[] key, int value)
key
- keyvalue
- valuepublic int get(byte[] key)
key
- key to be looked up
-1
if the key was not foundprotected void rehash(int s)
ASet
rehash
in class TokenSet
s
- new hash size
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |