public abstract class ASet extends Object
Modifier and Type | Field and Description |
---|---|
protected int[] |
buckets
Hash table buckets.
|
protected int[] |
next
Pointers to the next entry.
|
protected int |
size
Hash entries.
|
Modifier | Constructor and Description |
---|---|
protected |
ASet()
Empty constructor.
|
protected |
ASet(int capacity)
Initializes the data structure with an initial array size.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkSize()
Resizes the hash table.
|
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.
|
protected int[] buckets
protected int[] next
protected int size
size - 1
.protected ASet()
protected ASet(int capacity)
capacity
- initial array capacity (will be resized to a power of two)public final int size()
public final boolean isEmpty()
protected final void checkSize()
protected abstract int hash(int id)
id
- id of the elementprotected abstract void rehash(int newSize)
newSize
- new hash sizeCopyright © 2005–2015 BaseX Team. All rights reserved.