Modifier and Type | Class and Description |
---|---|
static class |
SparseIntVector.Snapshot
a simplistic snapshot implementation that stores set indices/values in order to save space
|
Constructor and Description |
---|
SparseIntVector()
Creates a SimplePool that holds about 716 elements before first
rehash.
|
SparseIntVector(int pow,
int defValue)
Creates a SimplePool that holds about 0.7 * 2**pow elements before
first rehash.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
clear(int idx) |
SparseIntVector |
clone() |
int |
get(int idx) |
SparseIntVector.Snapshot |
getSnapshot() |
static void |
main(String[] args) |
protected int |
mix(int x) |
protected void |
newTable() |
void |
restore(SparseIntVector.Snapshot snap) |
void |
set(int idx,
int val) |
void |
setRange(int fromIndex,
int toIndex,
int val) |
int |
size() |
public SparseIntVector()
public SparseIntVector(int pow, int defValue)
protected void newTable()
protected int mix(int x)
public SparseIntVector.Snapshot getSnapshot()
public void restore(SparseIntVector.Snapshot snap)
public SparseIntVector clone()
public int size()
public void clear()
public void clear(int idx)
public int get(int idx)
public void set(int idx, int val)
public void setRange(int fromIndex, int toIndex, int val)
public static void main(String[] args)