Class BitSet<T>
java.lang.Object
com.ibm.wala.util.intset.BitSet<T>
A bit set is a set of elements, each of which corresponds to a unique integer from [0,MAX].
-
Constructor Summary
ConstructorDescriptionBitSet
(OrdinalSetMapping<T> map) Constructor: create an empty set corresponding to a given mapping -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an object to this bit set.void
Add all elements in bitset B to this bit setvoid
Add all bits in BitVector B to this bit setvoid
Remove an object from this bit set.void
clearAll()
Set all the bits to 0.boolean
Does this set contain a certain object?void
Method copy.static <T> BitSet
<T> createBitSet
(BitSet<T> B) void
difference
(BitSet<T> other) Perform the difference of two bit setsvoid
Perform intersection of two bitsetsboolean
isEmpty()
iterator()
Not very efficient.int
length()
boolean
Does this object hold the same bits as other?void
setAll()
Set all the bits to 1.int
size()
toString()
-
Constructor Details
-
BitSet
Constructor: create an empty set corresponding to a given mapping- Throws:
IllegalArgumentException
- if map is null
-
-
Method Details
-
createBitSet
-
addAll
Add all elements in bitset B to this bit set- Throws:
IllegalArgumentException
- if B is null
-
addAll
Add all bits in BitVector B to this bit set -
add
Add an object to this bit set. -
clear
-
contains
Does this set contain a certain object? -
toString
-
copyBits
Method copy. Copies the bits in the bit vector, but only assigns the object map. No need to create a new object/bit bijection object.- Throws:
IllegalArgumentException
- if other is null
-
sameBits
Does this object hold the same bits as other?- Throws:
IllegalArgumentException
- if other is null
-
iterator
-
size
public int size() -
length
public int length() -
clearAll
public void clearAll()Set all the bits to 0. -
setAll
public void setAll()Set all the bits to 1. -
intersect
Perform intersection of two bitsets- Parameters:
other
- the other bitset in the operation- Throws:
IllegalArgumentException
- if other is null
-
difference
Perform the difference of two bit sets- Parameters:
other
- the other bitset in the operation- Throws:
IllegalArgumentException
- if other is null
-
isEmpty
public boolean isEmpty()
-