Package org.basex.util.hash
Class TokenBoolMap
java.lang.Object
org.basex.util.hash.ASet
org.basex.util.hash.TokenSet
org.basex.util.hash.TokenBoolMap
- All Implemented Interfaces:
Iterable<byte[]>
This is an efficient and memory-saving hash map for storing tokens and booleans.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.basex.util.hash.TokenSet
add, add, clear, contains, hash, id, iterator, key, put, read, remove, writeMethods inherited from class org.basex.util.hash.ASet
capacity, checkSize, isEmpty, size, toString, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
TokenBoolMap
public TokenBoolMap()Constructor.
-
-
Method Details
-
put
public void put(byte[] key, boolean value) Indexes the specified key and stores the associated value. If the key already exists, the value is updated.- Parameters:
key- keyvalue- value
-
get
public boolean get(byte[] key) Returns the value for the specified key.- Parameters:
key- key to be looked up- Returns:
- value, or
-1if the key was not found
-
rehash
protected void rehash(int newSize) Description copied from class:ASetRehashes all entries. -
toString
-