jebl.util
Class FixedBitSet
java.lang.Object
jebl.util.FixedBitSet
public class FixedBitSet
- extends Object
A bit-set of fixed size. Size is determined on creation.
- Author:
- Joseph Heled
FixedBitSet
public FixedBitSet(int size)
FixedBitSet
public FixedBitSet(FixedBitSet bs)
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