Class BitVectorBase<T extends BitVectorBase>
java.lang.Object
com.ibm.wala.util.intset.BitVectorBase<T>
- All Implemented Interfaces:
Serializable, Cloneable
- Direct Known Subclasses:
BitVector, OffsetBitVector
public abstract class BitVectorBase<T extends BitVectorBase>
extends Object
implements Cloneable, Serializable
Abstract base class for implementations of bitvectors
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int[]protected static final intprotected static final booleanprotected static final intprotected static final intprotected static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidabstract voidabstract voidclear(int bit) final voidclearAll()Clears all bits.clone()booleancontains(int i) voidcopyBits(BitVectorBase set) Copies the values of the bits in the specified set into this set.abstract booleanget(int bit) inthashCode()abstract booleanintersectionEmpty(T other) abstract booleanbooleanisZero()abstract intlength()intmax()intnextSetBit(int start) abstract voidfinal intHow many bits are set?abstract booleanabstract voidset(int bit) static intsubscript(int bitIndex) Convert bitIndex to a subscript into the bits[] array.toString()abstract void
-
Field Details
-
DEBUG
protected static final boolean DEBUG- See Also:
-
LOG_BITS_PER_UNIT
protected static final int LOG_BITS_PER_UNIT- See Also:
-
BITS_PER_UNIT
protected static final int BITS_PER_UNIT- See Also:
-
MASK
protected static final int MASK- See Also:
-
LOW_MASK
protected static final int LOW_MASK- See Also:
-
bits
protected int[] bits
-
-
Constructor Details
-
BitVectorBase
public BitVectorBase()
-
-
Method Details
-
set
public abstract void set(int bit) -
clear
public abstract void clear(int bit) -
get
public abstract boolean get(int bit) -
length
public abstract int length() -
and
-
andNot
-
or
-
xor
-
sameBits
-
isSubset
-
intersectionEmpty
-
subscript
public static int subscript(int bitIndex) Convert bitIndex to a subscript into the bits[] array. -
clearAll
public final void clearAll()Clears all bits. -
hashCode
-
populationCount
public final int populationCount()How many bits are set? -
isZero
public boolean isZero() -
clone
-
toString
-
contains
public boolean contains(int i) - See Also:
-
max
public int max() -
nextSetBit
public int nextSetBit(int start) - Returns:
- min j >= start s.t get(j)
-
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
-