com.ibm.wala.util.intset
Class BitVectorBase<T extends BitVectorBase>

java.lang.Object
  extended by com.ibm.wala.util.intset.BitVectorBase<T>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
BitVector, OffsetBitVector

public abstract class BitVectorBase<T extends BitVectorBase>
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Abstract base class for implementations of bitvectors

See Also:
Serialized Form

Field Summary
protected  int[] bits
           
protected static int BITS_PER_UNIT
           
protected static boolean DEBUG
           
protected static int LOG_BITS_PER_UNIT
           
protected static int LOW_MASK
           
protected static int MASK
           
 
Constructor Summary
BitVectorBase()
           
 
Method Summary
abstract  void and(T other)
           
abstract  void andNot(T other)
           
abstract  void clear(int bit)
           
 void clearAll()
          Clears all bits.
 java.lang.Object clone()
           
 boolean contains(int i)
           
 void copyBits(BitVectorBase set)
          Copies the values of the bits in the specified set into this set.
abstract  boolean get(int bit)
           
 int hashCode()
           
abstract  boolean intersectionEmpty(T other)
           
abstract  boolean isSubset(T other)
           
 boolean isZero()
           
abstract  int length()
           
 int max()
           
 int nextSetBit(int start)
           
abstract  void or(T other)
           
 int populationCount()
          How many bits are set?
abstract  boolean sameBits(T other)
           
abstract  void set(int bit)
           
static int subscript(int bitIndex)
          Convert bitIndex to a subscript into the bits[] array.
 java.lang.String toString()
           
abstract  void xor(T other)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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
Constructor Detail

BitVectorBase

public BitVectorBase()
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.


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

populationCount

public final int populationCount()
How many bits are set?


isZero

public boolean isZero()

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

contains

public boolean contains(int i)

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:
java.lang.IllegalArgumentException - if set is null