public class BitVector
extends java.lang.Object
Constructor and Description |
---|
BitVector() |
BitVector(BitVector other)
Copy constructor
|
BitVector(int numBits) |
Modifier and Type | Method and Description |
---|---|
void |
and(BitVector other) |
static BitVector |
and(BitVector set1,
BitVector set2) |
void |
andNot(BitVector other) |
int |
cardinality()
Count the number of ones in the bitvector.
|
void |
clear(int bit) |
java.lang.Object |
clone() |
void |
copyFrom(BitVector other) |
boolean |
equals(java.lang.Object o) |
boolean |
get(int bit) |
int |
hashCode() |
boolean |
intersects(BitVector other)
Returns true if the both the current and the specified
bitvectors have at least one bit set in common.
|
BitSetIterator |
iterator() |
int |
length()
Returns index of highest-numbered one bit.
|
void |
or(BitVector other) |
static BitVector |
or(BitVector set1,
BitVector set2) |
boolean |
orAndAndNot(BitVector orset,
BitVector andset,
BitVector andnotset)
Computes this = this OR ((orset AND andset ) AND (NOT andnotset))
Returns true iff this is modified.
|
boolean |
set(int bit) |
int |
size()
Returns number of bits in the underlying array.
|
java.lang.String |
toString() |
void |
xor(BitVector other) |
public BitVector()
public BitVector(BitVector other)
public BitVector(int numBits)
public void and(BitVector other)
public void andNot(BitVector other)
public void clear(int bit)
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean get(int bit)
public int hashCode()
hashCode
in class java.lang.Object
public int length()
public void copyFrom(BitVector other)
public void or(BitVector other)
public int cardinality()
public boolean intersects(BitVector other)
public void xor(BitVector other)
public boolean set(int bit)
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean orAndAndNot(BitVector orset, BitVector andset, BitVector andnotset)
set
- a bit set.public BitSetIterator iterator()