Package com.ibm.wala.util.intset
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]bitsprotected static intBITS_PER_UNITprotected static booleanDEBUGprotected static intLOG_BITS_PER_UNITprotected static intLOW_MASKprotected static intMASK
-
Constructor Summary
Constructors Constructor Description BitVectorBase()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidand(T other)abstract voidandNot(T other)abstract voidclear(int bit)voidclearAll()Clears all bits.Objectclone()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 booleanisSubset(T other)booleanisZero()abstract intlength()intmax()intnextSetBit(int start)abstract voidor(T other)intpopulationCount()How many bits are set?abstract booleansameBits(T other)abstract voidset(int bit)static intsubscript(int bitIndex)Convert bitIndex to a subscript into the bits[] array.StringtoString()abstract voidxor(T other)
-
-
-
Field Detail
-
DEBUG
protected static final boolean DEBUG
- See Also:
- Constant Field Values
-
LOG_BITS_PER_UNIT
protected static final int LOG_BITS_PER_UNIT
- See Also:
- Constant Field Values
-
BITS_PER_UNIT
protected static final int BITS_PER_UNIT
- See Also:
- Constant Field Values
-
MASK
protected static final int MASK
- See Also:
- Constant Field Values
-
LOW_MASK
protected static final int LOW_MASK
- See Also:
- Constant Field Values
-
bits
protected int[] bits
-
-
Method Detail
-
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
public abstract void and(T other)
-
andNot
public abstract void andNot(T other)
-
or
public abstract void or(T other)
-
xor
public abstract void xor(T other)
-
sameBits
public abstract boolean sameBits(T other)
-
isSubset
public abstract boolean isSubset(T other)
-
intersectionEmpty
public abstract boolean intersectionEmpty(T other)
-
subscript
public static int subscript(int bitIndex)
Convert bitIndex to a subscript into the bits[] array.
-
clearAll
public final void clearAll()
Clears all bits.
-
populationCount
public final int populationCount()
How many bits are set?
-
isZero
public boolean isZero()
-
contains
public boolean contains(int i)
- See Also:
IntSet.contains(int)
-
max
public int max()
-
nextSetBit
public int nextSetBit(int start)
- Returns:
- min j >= start s.t get(j)
-
copyBits
public void copyBits(BitVectorBase set)
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
-
-