|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectLongSet
public class LongSet
A fast, expandible set of positive numeric values, stored as a hash. Doesn't support deletion, and isn't very good at handling sequential values, so beware.
Field Summary | |
---|---|
private int |
curSize
|
private long[] |
ents
|
private int |
hashSize
|
Constructor Summary | |
---|---|
LongSet(int maxSize)
Create the hash table that can comfortably hold the specified number of entries. |
Method Summary | |
---|---|
void |
add(long val)
Add a value to the set, if it's not already present. |
boolean |
contains(long val)
Check if the given value is contained in the set. |
private void |
grow()
Expand the table and re-hash the existing entries. |
int |
size()
Tells how many entries are currently in the set |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int hashSize
private long[] ents
private int curSize
Constructor Detail |
---|
public LongSet(int maxSize)
maxSize
- Max # of entriesMethod Detail |
---|
public void add(long val)
public boolean contains(long val)
private void grow()
public int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |