public class LongSet
extends Object
Modifier and Type | Field and Description |
---|---|
private int |
curSize |
private long[] |
ents |
private int |
hashSize |
Constructor and Description |
---|
LongSet(int maxSize)
Create the hash table that can comfortably hold the specified number
of entries.
|
Modifier and Type | Method and Description |
---|---|
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
|
public LongSet(int maxSize)
maxSize
- Max # of entriespublic void add(long val)
public boolean contains(long val)
private void grow()
public int size()