Package org.basex.query.util.hash
Class HashItemSet
java.lang.Object
org.basex.util.hash.ASet
org.basex.query.util.hash.HashItemSet
This is an efficient and memory-saving hash map for storing items.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanStores the specified key if it has not been stored before.booleanChecks if the specified item exists.protected inthash(int id) Returns the hash value of the element with the specified id.intReturns the id of the specified QName, or0if the QName does not exist.iterator()protected voidrehash(int newSize) Rehashes all entries.toString()Methods inherited from class org.basex.util.hash.ASet
capacity, checkSize, clear, 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
-
HashItemSet
public HashItemSet(boolean eq) Default constructor.- Parameters:
eq- equality check
-
-
Method Details
-
add
Description copied from interface:ItemSetStores the specified key if it has not been stored before.- Specified by:
addin interfaceItemSet- Parameters:
item- key to be addedii- input info (can benull)- Returns:
trueif the key did not exist yet and was stored- Throws:
QueryException- query exception
-
contains
Checks if the specified item exists.- Parameters:
item- item to look upii- input info (can benull)- Returns:
- result of check
- Throws:
QueryException- query exception
-
id
Returns the id of the specified QName, or0if the QName does not exist.- Parameters:
item- item to look upii- input info (can benull)- Returns:
- id, or
0if QName does not exist - Throws:
QueryException- query exception
-
hash
protected int hash(int id) Description copied from class:ASetReturns the hash value of the element with the specified id. -
rehash
protected void rehash(int newSize) Description copied from class:ASetRehashes all entries. -
iterator
-
toString
-