public final class BitSet<T> extends Object
Constructor and Description |
---|
BitSet(OrdinalSetMapping<T> map)
Constructor: create an empty set corresponding to a given mapping
|
Modifier and Type | Method and Description |
---|---|
void |
add(T o)
Add an object to this bit set.
|
void |
addAll(BitSet<?> B)
Add all elements in bitset B to this bit set
|
void |
addAll(BitVector B)
Add all bits in BitVector B to this bit set
|
void |
clear(T o)
Remove an object from this bit set.
|
void |
clearAll()
Set all the bits to 0.
|
boolean |
contains(T o)
Does this set contain a certain object?
|
void |
copyBits(BitSet<T> other)
Method copy.
|
static <T> BitSet<T> |
createBitSet(BitSet<T> B) |
void |
difference(BitSet<T> other)
Perform the difference of two bit sets
|
void |
intersect(BitSet<?> other)
Perform intersection of two bitsets
|
boolean |
isEmpty() |
Iterator<T> |
iterator()
Not very efficient.
|
int |
length() |
boolean |
sameBits(BitSet<?> other)
Does this object hold the same bits as other?
|
void |
setAll()
Set all the bits to 1.
|
int |
size() |
String |
toString() |
public BitSet(OrdinalSetMapping<T> map)
IllegalArgumentException
- if map is nullpublic void addAll(BitSet<?> B)
IllegalArgumentException
- if B is nullpublic void addAll(BitVector B)
public void add(T o)
public void clear(T o)
o
- the object to removepublic boolean contains(T o)
public String toString()
public void copyBits(BitSet<T> other)
IllegalArgumentException
- if other is nullpublic boolean sameBits(BitSet<?> other)
IllegalArgumentException
- if other is nullpublic int size()
public int length()
public void clearAll()
public void setAll()
public void intersect(BitSet<?> other)
other
- the other bitset in the operationIllegalArgumentException
- if other is nullpublic void difference(BitSet<T> other)
other
- the other bitset in the operationIllegalArgumentException
- if other is nullpublic boolean isEmpty()