java.lang.Object
org.maxicp.state.datastructures.BitSet
- Direct Known Subclasses:
StateSparseBitSet.CollectionBitSet,StateSparseBitSet.SupportBitSet
Bitset abstract class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Unset all the bitsvoidMakes the intersection with another bit-set but only on non zero-words of the outer sparse-bit-set.voidinvert()voidset(int i) Set the ith bit up (value 1).toString()voidMakes the union with another bit-set but only on non zero-words of the outer sparse-bit-set.voidunset(int i) Set the ith bit down (value 0).
-
Field Details
-
words
protected long[] words -
nbWords
protected int nbWords
-
-
Constructor Details
-
BitSet
public BitSet(int nWords) Initializes a bit-set. All the bits are initially unset. The set it represents is thus empty. -
BitSet
Copy a bitset. The bit set in anotherBitSet are also set here.- Parameters:
anotherBitSet- bitset to be copied
-
BitSet
Copy or share a bitset. If the sharing is chosen, operations on one impacts the other as well- Parameters:
anotherBitSet- bitset to be copied/sharedshared- true if the internal representation is meant to be shared between multiple bitsets
-
-
Method Details
-
set
public void set(int i) Set the ith bit up (value 1).- Parameters:
i- the bit to set
-
unset
public void unset(int i) Set the ith bit down (value 0).- Parameters:
i- the bit to set
-
clear
public void clear()Unset all the bits -
union
Makes the union with another bit-set but only on non zero-words of the outer sparse-bit-set.- Parameters:
other- the other bit-set to make the union with
-
intersect
Makes the intersection with another bit-set but only on non zero-words of the outer sparse-bit-set.- Parameters:
other- the other bit-set to make the intersection with
-
invert
public void invert() -
toString
-