|
||||||||||
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.TokenMap
public class TokenMap
This is an efficient and memory-saving hash map for storing tokens.
It extends the TokenSet
class.
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 | |
---|---|
TokenMap()
|
Method Summary | |
---|---|
int |
delete(byte[] key)
Deletes the specified key. |
byte[] |
get(byte[] key)
Returns the value for the specified key. |
void |
put(byte[] key,
byte[] value)
Stores the specified key and value. |
void |
put(java.lang.String key,
java.lang.String value)
Convenience function for adding strings, which will be converted to tokens. |
protected void |
rehash(int s)
Rehashes all entries. |
java.lang.String |
toString()
|
java.lang.Iterable<byte[]> |
values()
Returns a value iterator. |
Methods inherited from class org.basex.util.hash.TokenSet |
---|
add, add, clear, contains, hash, id, iterator, key, put, read, write |
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 TokenMap()
Method Detail |
---|
public final void put(byte[] key, byte[] value)
key
- keyvalue
- valuepublic final void put(java.lang.String key, java.lang.String value)
key
- keyvalue
- valuepublic final byte[] get(byte[] key)
key
- key to be looked up
null
if nothing was foundpublic int delete(byte[] key)
TokenSet
ASet.size
is called after
deletions, the original number of entries will be returned.
delete
in class TokenSet
key
- key
public final java.lang.Iterable<byte[]> values()
protected final void rehash(int s)
ASet
rehash
in class TokenSet
s
- new hash sizepublic final java.lang.String toString()
toString
in class TokenSet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |