public class SentinelIntSet extends Object
Modifier and Type | Field and Description |
---|---|
int |
count |
int |
emptyVal |
int[] |
keys |
int |
rehashCount |
Constructor and Description |
---|
SentinelIntSet(int size,
int emptyVal) |
public int[] keys
public int count
public final int emptyVal
public int rehashCount
public SentinelIntSet(int size, int emptyVal)
size
- The minimum number of elements this set should be able to hold without re-hashing (i.e. the slots are guaranteed not to change)emptyVal
- The integer value to use for EMPTYpublic void clear()
public int hash(int key)
public int size()
public int getSlot(int key)
public int find(int key)
public boolean exists(int key)
public int put(int key)
public void rehash()