public class MutableSparseIntSet extends SparseIntSet implements MutableIntSet
This implementation will be inefficient if these sets get large.
TODO: even for small sets, we probably want to work on this to reduce the allocation activity.
elements, size| Modifier | Constructor and Description |
|---|---|
protected |
MutableSparseIntSet() |
protected |
MutableSparseIntSet(int[] backingStore) |
protected |
MutableSparseIntSet(IntSet set) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int value)
Add an integer value to this set.
|
boolean |
addAll(IntSet set)
Add all elements from another int set.
|
boolean |
addAll(SparseIntSet that)
Add all elements from another int set.
|
boolean |
addAllInIntersection(IntSet other,
IntSet filter) |
void |
clear()
remove all elements from this set
|
void |
copySet(IntSet that)
Set the value of this to be the same as the value of set
|
static MutableSparseIntSet |
createMutableSparseIntSet(int initialCapacity) |
static MutableSparseIntSet |
diff(MutableSparseIntSet A,
MutableSparseIntSet B) |
float |
getExpansionFactor() |
int |
getInitialNonEmptySize() |
void |
intersectWith(IntSet set)
Intersect this with another set.
|
void |
intersectWith(SparseIntSet set) |
static MutableSparseIntSet |
make(IntSet set) |
static MutableSparseIntSet |
makeEmpty() |
boolean |
remove(int value)
Remove an integer from this set.
|
void |
removeAll(BitVectorIntSet v) |
void |
removeAll(MutableSparseIntSet set)
TODO optimize
|
<T extends BitVectorBase<T>> |
removeAll(T v) |
add, contains, containsAny, containsAny, diff, diffInternal, elementAt, foreach, foreachExcluding, getIndex, intersection, intIterator, isEmpty, isSubset, max, pair, parseIntArray, sameValue, singleton, size, toIntArray, toString, unionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, containsAny, foreach, foreachExcluding, intersection, intIterator, isEmpty, isSubset, max, sameValue, size, unionprotected MutableSparseIntSet(IntSet set)
protected MutableSparseIntSet(int[] backingStore)
protected MutableSparseIntSet()
public void clear()
MutableIntSetclear in interface MutableIntSetpublic boolean remove(int value)
MutableIntSetremove in interface MutableIntSetvalue - integer to removepublic int getInitialNonEmptySize()
public float getExpansionFactor()
public boolean add(int value)
MutableIntSetadd in interface MutableIntSetvalue - integer to addpublic void copySet(IntSet that) throws IllegalArgumentException
MutableIntSetcopySet in interface MutableIntSetIllegalArgumentException - if that == nullpublic void intersectWith(IntSet set)
MutableIntSetintersectWith in interface MutableIntSetpublic void intersectWith(SparseIntSet set)
public boolean addAll(IntSet set) throws IllegalArgumentException
addAll in interface MutableIntSetIllegalArgumentException - if set == nullpublic boolean addAll(SparseIntSet that)
public void removeAll(BitVectorIntSet v)
public <T extends BitVectorBase<T>> void removeAll(T v)
public void removeAll(MutableSparseIntSet set)
IllegalArgumentException - if set is nullpublic boolean addAllInIntersection(IntSet other, IntSet filter)
addAllInIntersection in interface MutableIntSetpublic static MutableSparseIntSet diff(MutableSparseIntSet A, MutableSparseIntSet B)
public static MutableSparseIntSet make(IntSet set)
public static MutableSparseIntSet makeEmpty()
public static MutableSparseIntSet createMutableSparseIntSet(int initialCapacity) throws IllegalArgumentException
IllegalArgumentException