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
IllegalArgumentException
public void clear()
MutableIntSet
clear
in interface MutableIntSet
public void copySet(IntSet set) throws IllegalArgumentException
MutableIntSet
copySet
in interface MutableIntSet
IllegalArgumentException
public boolean addAll(IntSet set)
MutableIntSet
addAll
in interface MutableIntSet
public void addAllOblivious(IntSet set) throws IllegalArgumentException
set
- IllegalArgumentException
- if set == nullpublic 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)
MutableIntSet
intersectWith
in interface MutableIntSet
public BitVectorIntSet intersection(IntSet that)
IntSet
intersection
in interface IntSet
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 SparseIntSet makeSparseCopy()
public void foreachExcluding(IntSet X, IntSetAction action)
IntSet
foreachExcluding
in interface IntSet
public boolean contains(int i)
public int nextSetBit(int n)
public boolean sameValue(IntSet that) throws IllegalArgumentException, UnimplementedError
sameValue
in interface IntSet
this
has the same value as that
.IllegalArgumentException
UnimplementedError
public boolean isSubset(IntSet that)
public BitVector getBitVector()
public SparseIntSet toSparseIntSet()
public boolean removeAll(BitVectorIntSet set)
set
- IllegalArgumentException
- if set is nullpublic boolean containsAny(IntSet set) throws IllegalArgumentException
containsAny
in interface IntSet
IllegalArgumentException
public boolean addAllInIntersection(IntSet other, IntSet filter) throws IllegalArgumentException
addAllInIntersection
in interface MutableIntSet
IllegalArgumentException
public boolean containsAll(BitVectorIntSet other)