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
ConstructorsConstructorDescriptionBitSet(OrdinalSetMapping<T> map) Constructor: create an empty set corresponding to a given mapping -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an object to this bit set.voidAdd all elements in bitset B to this bit setvoidAdd all bits in BitVector B to this bit setvoidRemove an object from this bit set.voidclearAll()Set all the bits to 0.booleanDoes this set contain a certain object?voidMethod copy.static <T> BitSet<T> createBitSet(BitSet<T> B) voiddifference(BitSet<T> other) Perform the difference of two bit setsvoidPerform intersection of two bitsetsbooleanisEmpty()iterator()Not very efficient.intlength()booleanDoes this object hold the same bits as other?voidsetAll()Set all the bits to 1.intsize()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()
-