|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.util.hash.ASet
public abstract class ASet
This is the basic structure of an efficient and memory-saving hash set. The first entry of the token set (offset 0) will always be kept empty.
Field Summary | |
---|---|
protected int[] |
bucket
Hash table buckets. |
protected int[] |
next
Pointers to the next entry. |
protected int |
size
Hash entries. |
Constructor Summary | |
---|---|
protected |
ASet()
Empty constructor. |
protected |
ASet(int capacity)
Initializes the data structure with an initial array size. |
Method Summary | |
---|---|
protected void |
checkSize()
Resizes the hash table. |
void |
clear()
Resets the data structure. |
protected abstract int |
hash(int id)
Returns the hash value of the element with the specified id. |
boolean |
isEmpty()
Tests is the set is empty. |
protected abstract void |
rehash(int newSize)
Rehashes all entries. |
int |
size()
Returns the number of entries. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int[] bucket
protected int[] next
protected int size
size - 1
.
Constructor Detail |
---|
protected ASet()
protected ASet(int capacity)
capacity
- initial array capacity (will be resized to a power of two)Method Detail |
---|
public void clear()
public final int size()
public final boolean isEmpty()
protected final void checkSize()
protected abstract int hash(int id)
id
- id of the element
protected abstract void rehash(int newSize)
newSize
- new hash size
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |