Class FixedSizeBitVector
java.lang.Object
com.ibm.wala.util.intset.FixedSizeBitVector
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFixedSizeBitVector
(int nbits) Creates an empty string with the specified size.Creates a copy of a Bit String -
Method Summary
Modifier and TypeMethodDescriptionvoid
and
(FixedSizeBitVector set) Logically ANDs this bit set with the specified set of bits.static FixedSizeBitVector
and
(FixedSizeBitVector b1, FixedSizeBitVector b2) Return a new bit string as the AND of two others.void
clear
(int bit) Clears a bit.void
clearAll()
Clears all bits.clone()
Clones the FixedSizeBitVector.void
Copies the values of the bits in the specified set into this set.boolean
Compares this object against the specified object.boolean
get
(int bit) Gets a bit.int
hashCode()
Gets the hashcode.boolean
Check if the intersection of the two sets is emptyboolean
isZero()
int
length()
Calculates and returns the set's size in bits.void
not()
Logically NOT this bit stringstatic FixedSizeBitVector
Return the NOT of a bit stringvoid
or
(FixedSizeBitVector set) Logically ORs this bit set with the specified set of bits.static FixedSizeBitVector
or
(FixedSizeBitVector b1, FixedSizeBitVector b2) Return a new FixedSizeBitVector as the OR of two othersint
How many bits are set?void
set
(int bit) Sets a bit.void
setAll()
Sets all bits.toString()
Converts the FixedSizeBitVector to a String.void
xor
(FixedSizeBitVector set) Logically XORs this bit set with the specified set of bits.
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
-
Constructor Details
-
FixedSizeBitVector
public FixedSizeBitVector(int nbits) Creates an empty string with the specified size.- Parameters:
nbits
- the size of the string
-
FixedSizeBitVector
Creates a copy of a Bit String- Parameters:
s
- the string to copy- Throws:
IllegalArgumentException
- if s is null
-
-
Method Details
-
setAll
public void setAll()Sets all bits. -
set
public void set(int bit) Sets a bit.- Parameters:
bit
- the bit to be set
-
clearAll
public void clearAll()Clears all bits. -
clear
public void clear(int bit) Clears a bit.- Parameters:
bit
- the bit to be cleared
-
get
public boolean get(int bit) Gets a bit.- Parameters:
bit
- the bit to be gotten
-
not
public void not()Logically NOT this bit string -
not
Return the NOT of a bit string -
and
Logically ANDs this bit set with the specified set of bits.- Parameters:
set
- the bit set to be ANDed with
-
and
Return a new bit string as the AND of two others. -
or
Logically ORs this bit set with the specified set of bits.- Parameters:
set
- the bit set to be ORed with- Throws:
IllegalArgumentException
- if set == null
-
or
public static FixedSizeBitVector or(FixedSizeBitVector b1, FixedSizeBitVector b2) throws IllegalArgumentException Return a new FixedSizeBitVector as the OR of two others- Throws:
IllegalArgumentException
- if b2 == null
-
xor
Logically XORs this bit set with the specified set of bits.- Parameters:
set
- the bit set to be XORed with- Throws:
IllegalArgumentException
- if set is null
-
intersectionEmpty
Check if the intersection of the two sets is empty- Parameters:
other
- the set to check intersection with
-
copyBits
Copies the values of the bits in the specified set into this set.- Parameters:
set
- the bit set to copy the bits from- Throws:
IllegalArgumentException
- if set is null
-
hashCode
-
populationCount
public int populationCount()How many bits are set? -
length
public int length()Calculates and returns the set's size in bits. The maximum element in the set is the size - 1st element. -
equals
-
isZero
public boolean isZero() -
clone
-
toString
-