fr.inria.oadymppac.solver
Class EMNCountingBitSet

java.lang.Object
  extended byjava.util.BitSet
      extended byfr.inria.oadymppac.solver.EMNCountingBitSet
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class EMNCountingBitSet
extends java.util.BitSet

A BitSet that maintains the count of bits set to 1.

Version:
$Revision: 1.1 $
Author:
Jean-Daniel Fekete
See Also:
Serialized Form

Constructor Summary
EMNCountingBitSet()
          Creates a new counting bit set.
EMNCountingBitSet(EMNCountingBitSet other)
          Copy a counting bit.
EMNCountingBitSet(int nbits)
          Creates a counting bit set whose initial size is large enough to explicitly represent bits with indices in the range 0 through nbits-1.
 
Method Summary
 void and(java.util.BitSet set)
           
 void andNot(java.util.BitSet set)
           
 void clear(int bitIndex)
          Sets the bit specified by the index to false.
 int getTrueCount()
           
 void or(java.util.BitSet set)
           
 void set(int bitIndex)
          Sets the bit specified by the index to true.
 void xor(java.util.BitSet set)
           
 
Methods inherited from class java.util.BitSet
cardinality, clear, clear, clone, equals, flip, flip, get, get, hashCode, intersects, isEmpty, length, nextClearBit, nextSetBit, set, set, set, size, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EMNCountingBitSet

public EMNCountingBitSet()
Creates a new counting bit set. All bits are initially false.


EMNCountingBitSet

public EMNCountingBitSet(int nbits)
Creates a counting bit set whose initial size is large enough to explicitly represent bits with indices in the range 0 through nbits-1. All bits are initially false.

Parameters:
nbits - the initial size of the bit set.
Throws:
java.lang.NegativeArraySizeException - if the specified initial size is negative.

EMNCountingBitSet

public EMNCountingBitSet(EMNCountingBitSet other)
Copy a counting bit.

Method Detail

clear

public void clear(int bitIndex)
Sets the bit specified by the index to false.

Parameters:
bitIndex - the index of the bit to be cleared.
Throws:
java.lang.IndexOutOfBoundsException - if the specified index is negative.
Since:
JDK1.0

set

public void set(int bitIndex)
Sets the bit specified by the index to true.

Parameters:
bitIndex - a bit index.
Throws:
java.lang.IndexOutOfBoundsException - if the specified index is negative.
Since:
JDK1.0

getTrueCount

public int getTrueCount()

and

public void and(java.util.BitSet set)

or

public void or(java.util.BitSet set)

andNot

public void andNot(java.util.BitSet set)

xor

public void xor(java.util.BitSet set)