public class BimodalMutableIntSet extends Object implements MutableIntSet
MutableIntSet
that delegates to either a MutableSparseIntSet
or a BitVectorIntSet
Constructor and Description |
---|
BimodalMutableIntSet() |
BimodalMutableIntSet(BimodalMutableIntSet x) |
BimodalMutableIntSet(int initialSize,
float expansionFactor) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(int i)
Add an integer value to this set.
|
boolean |
addAll(IntSet set)
Add all members of set to this.
|
boolean |
addAllInIntersection(IntSet other,
IntSet filter) |
void |
clear()
remove all elements from this set
|
boolean |
contains(int i) |
boolean |
containsAll(BimodalMutableIntSet that)
TODO: optimize ME!
|
boolean |
containsAny(IntSet that) |
void |
copySet(IntSet set)
Set the value of this to be the same as the value of set
|
void |
foreach(IntSetAction action)
Invoke an action on each element of the Set
|
void |
foreachExcluding(IntSet X,
IntSetAction action)
Invoke an action on each element of the Set, excluding elements of Set X
|
IntSet |
getBackingStore()
use with care
|
IntSet |
intersection(IntSet that)
This implementation must not despoil the original value of "this"
|
void |
intersectWith(IntSet set)
Intersect this with another set.
|
IntIterator |
intIterator() |
boolean |
isEmpty() |
boolean |
isSubset(IntSet that) |
static BimodalMutableIntSet |
makeCopy(IntSet B) |
int |
max() |
boolean |
remove(int i)
Remove an integer from this set.
|
boolean |
removeAll(IntSet that)
TODO: optimize ME!
|
boolean |
sameValue(IntSet that) |
int |
size() |
String |
toString() |
IntSet |
union(IntSet that)
This implementation must not despoil the original value of "this"
|
public BimodalMutableIntSet()
public BimodalMutableIntSet(int initialSize, float expansionFactor)
public BimodalMutableIntSet(BimodalMutableIntSet x)
x
- IllegalArgumentException
- if x is nullpublic void copySet(IntSet set)
MutableIntSet
copySet
in interface MutableIntSet
public boolean addAll(IntSet set)
MutableIntSet
addAll
in interface MutableIntSet
public boolean addAllInIntersection(IntSet other, IntSet filter)
addAllInIntersection
in interface MutableIntSet
public boolean add(int i)
MutableIntSet
add
in interface MutableIntSet
i
- integer to addpublic boolean remove(int i)
MutableIntSet
remove
in interface MutableIntSet
i
- integer to removepublic void intersectWith(IntSet set) throws UnimplementedError
MutableIntSet
intersectWith
in interface MutableIntSet
UnimplementedError
public boolean contains(int i)
public IntSet intersection(IntSet that) throws UnimplementedError
IntSet
intersection
in interface IntSet
UnimplementedError
public IntSet union(IntSet that)
IntSet
public boolean isEmpty()
public int size()
public IntIterator intIterator()
intIterator
in interface IntSet
public void foreach(IntSetAction action)
IntSet
public void foreachExcluding(IntSet X, IntSetAction action)
IntSet
foreachExcluding
in interface IntSet
public int max() throws IllegalStateException
max
in interface IntSet
IllegalStateException
public static BimodalMutableIntSet makeCopy(IntSet B) throws UnimplementedError, IllegalArgumentException
public void clear()
MutableIntSet
clear
in interface MutableIntSet
public boolean sameValue(IntSet that)
public boolean isSubset(IntSet that) throws IllegalArgumentException
isSubset
in interface IntSet
this
is a subset of that
.IllegalArgumentException
public IntSet getBackingStore()
public boolean containsAny(IntSet that) throws IllegalArgumentException, UnimplementedError
containsAny
in interface IntSet
IllegalArgumentException
UnimplementedError
public boolean removeAll(IntSet that)
IllegalArgumentException
- if that is nullpublic boolean containsAll(BimodalMutableIntSet that)
IllegalArgumentException
- if that is null