jebl.util
Class FixedBitSet

java.lang.Object
  extended by jebl.util.FixedBitSet

public class FixedBitSet
extends Object

A bit-set of fixed size. Size is determined on creation.

Author:
Joseph Heled

Constructor Summary
FixedBitSet(FixedBitSet bs)
           
FixedBitSet(int size)
           
 
Method Summary
 int cardinality()
           
 void clear(int position)
           
 void complement()
           
static FixedBitSet complement(FixedBitSet b)
           
 boolean contains(int i)
           
 boolean equals(Object x)
           
 int hashCode()
           
 void intersect(FixedBitSet b)
           
 int intersectCardinality(FixedBitSet b)
           
 int nextOnBit(int fromIndex)
          Iteration helper.
 void set(int position)
           
 boolean setInclusion(FixedBitSet bitset)
           
 void setMinus(FixedBitSet b)
           
 String toString()
           
 void union(FixedBitSet b)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FixedBitSet

public FixedBitSet(int size)

FixedBitSet

public FixedBitSet(FixedBitSet bs)
Method Detail

set

public void set(int position)

clear

public void clear(int position)

setInclusion

public boolean setInclusion(FixedBitSet bitset)
Parameters:
bitset -
Returns:
true if bitset contains this set (this <= bitset)

union

public void union(FixedBitSet b)

intersect

public void intersect(FixedBitSet b)

setMinus

public void setMinus(FixedBitSet b)

intersectCardinality

public int intersectCardinality(FixedBitSet b)

complement

public static FixedBitSet complement(FixedBitSet b)

complement

public void complement()

nextOnBit

public int nextOnBit(int fromIndex)
Iteration helper. A typical iteration on set bits might be FixedBitSet b; for(int i = b.nextOnBit(0); i >= 0; i = b.nextOnBit(i+1)) ...

Parameters:
fromIndex -
Returns:
Next set member whose index is >= fromIndex. -1 if none.

cardinality

public int cardinality()

contains

public boolean contains(int i)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object x)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object