public final class BitVectorIntSet extends Object implements MutableIntSet
BitVector implementation of MutableIntSet.
Note that this is NOT a value with regard to hashCode and equals.
| Constructor and Description |
|---|
BitVectorIntSet() |
BitVectorIntSet(BitVector v) |
BitVectorIntSet(IntSet S) |
| 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 |
addAllOblivious(IntSet set)
this version of add all will likely be faster if the client doesn't care about the change or
the population count.
|
void |
clear()
remove all elements from this set
|
boolean |
contains(int i) |
boolean |
containsAll(BitVectorIntSet other) |
boolean |
containsAny(IntSet set) |
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
|
BitVector |
getBitVector() |
BitVectorIntSet |
intersection(IntSet that)
This implementation must not despoil the original value of "this"
|
void |
intersectWith(IntSet set)
Intersect this with another set.
|
IntIterator |
intIterator()
Use with extreme care; doesn't detect ConcurrentModificationExceptions
|
boolean |
isEmpty() |
boolean |
isSubset(IntSet that) |
SparseIntSet |
makeSparseCopy() |
int |
max() |
int |
nextSetBit(int n) |
boolean |
remove(int i)
Remove an integer from this set.
|
boolean |
removeAll(BitVectorIntSet set) |
boolean |
sameValue(IntSet that) |
int |
size() |
SparseIntSet |
toSparseIntSet()
TODO: optimize
|
String |
toString() |
IntSet |
union(IntSet that)
This implementation must not despoil the original value of "this"
|
public BitVectorIntSet()
public BitVectorIntSet(BitVector v)
public BitVectorIntSet(IntSet S) throws IllegalArgumentException
IllegalArgumentExceptionpublic void clear()
MutableIntSetclear in interface MutableIntSetpublic void copySet(IntSet set) throws IllegalArgumentException
MutableIntSetcopySet in interface MutableIntSetIllegalArgumentExceptionpublic boolean addAll(IntSet set)
MutableIntSetaddAll in interface MutableIntSetpublic void addAllOblivious(IntSet set) throws IllegalArgumentException
IllegalArgumentException - if set == nullpublic boolean add(int i)
MutableIntSetadd in interface MutableIntSeti - integer to addpublic boolean remove(int i)
MutableIntSetremove in interface MutableIntSeti - integer to removepublic void intersectWith(IntSet set)
MutableIntSetintersectWith in interface MutableIntSetpublic BitVectorIntSet intersection(IntSet that)
IntSetintersection in interface IntSetpublic IntSet union(IntSet that)
IntSetpublic boolean isEmpty()
public int size()
public IntIterator intIterator()
intIterator in interface IntSetpublic void foreach(IntSetAction action)
IntSetpublic SparseIntSet makeSparseCopy()
public void foreachExcluding(IntSet X, IntSetAction action)
IntSetforeachExcluding in interface IntSetpublic boolean contains(int i)
public int nextSetBit(int n)
public boolean sameValue(IntSet that) throws IllegalArgumentException, UnimplementedError
sameValue in interface IntSetthis has the same value as that.IllegalArgumentExceptionUnimplementedErrorpublic boolean isSubset(IntSet that)
public BitVector getBitVector()
public SparseIntSet toSparseIntSet()
public boolean removeAll(BitVectorIntSet set)
IllegalArgumentException - if set is nullpublic boolean containsAny(IntSet set) throws IllegalArgumentException
containsAny in interface IntSetIllegalArgumentExceptionpublic boolean addAllInIntersection(IntSet other, IntSet filter) throws IllegalArgumentException
addAllInIntersection in interface MutableIntSetIllegalArgumentExceptionpublic boolean containsAll(BitVectorIntSet other)