choco.util
Class BitSet

java.lang.Object
  extended by choco.util.BitSet

public class BitSet
extends java.lang.Object

Implements utilities for handling bit sets


Constructor Summary
BitSet()
           
 
Method Summary
static boolean getBit(int n, int i)
          tests whether the i-th bit of an search is on or off
static int getHeavierBit(int n)
          returns the heaviest bit on (-1 if none)
static int setBit(int n, int i)
          sets the i-th bit of an search (does nothing if it is already on)
static int unsetBit(int n, int i)
          sets the i-th bit of an search (does nothing if it is already on)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitSet

public BitSet()
Method Detail

getBit

public static boolean getBit(int n,
                             int i)
tests whether the i-th bit of an search is on or off


setBit

public static int setBit(int n,
                         int i)
sets the i-th bit of an search (does nothing if it is already on)


unsetBit

public static int unsetBit(int n,
                           int i)
sets the i-th bit of an search (does nothing if it is already on)


getHeavierBit

public static int getHeavierBit(int n)
returns the heaviest bit on (-1 if none)