|
||||||||||
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.query.util.HashItemSet
public class HashItemSet
This is an efficient and memory-saving hash map for storing items.
It is related to the TokenSet
class.
Field Summary |
---|
Fields inherited from class org.basex.util.hash.ASet |
---|
bucket, next, size |
Constructor Summary | |
---|---|
HashItemSet()
Default constructor. |
Method Summary | |
---|---|
boolean |
add(Item key,
InputInfo ii)
Stores the specified key if it has not been stored before. |
protected int |
hash(int id)
Returns the hash value of the element with the specified id. |
int |
id(Item key,
InputInfo ii)
Returns the id of the specified key, or 0 if the key does not exist. |
java.util.Iterator<Item> |
iterator()
|
int |
put(Item key,
InputInfo ii)
Stores the specified key and returns its id. |
protected void |
rehash(int newSize)
Rehashes all entries. |
Methods inherited from class org.basex.util.hash.ASet |
---|
checkSize, clear, isEmpty, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HashItemSet()
Method Detail |
---|
public final boolean add(Item key, InputInfo ii) throws QueryException
ItemSet
add
in interface ItemSet
key
- key to be addedii
- input info
QueryException
- query exceptionpublic int put(Item key, InputInfo ii) throws QueryException
key
- key to be addedii
- input info
QueryException
- query exceptionpublic final int id(Item key, InputInfo ii) throws QueryException
0
if the key does not exist.
key
- key to be looked upii
- input info
0
if key does not exist
QueryException
- query exceptionpublic java.util.Iterator<Item> iterator()
iterator
in interface java.lang.Iterable<Item>
protected int hash(int id)
ASet
hash
in class ASet
id
- id of the element
protected void rehash(int newSize)
ASet
rehash
in class ASet
newSize
- new hash size
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |