|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jikesrvm.util.BitVector
public final class BitVector
BitVector.java implements a bit vector
| Field Summary | |
|---|---|
private int[] |
bits
|
private static int |
LOG_BITS_PER_UNIT
|
private static int |
LOW_MASK
|
private static int |
MASK
|
private int |
nbits
|
(package private) static long |
serialVersionUID
Support for serialization |
| Constructor Summary | |
|---|---|
BitVector(BitVector s)
Creates a copy of a Bit String |
|
BitVector(int nbits)
Creates an empty string with the specified size. |
|
| Method Summary | |
|---|---|
void |
and(BitVector set)
Logically ANDs this bit set with the specified set of bits. |
static BitVector |
and(BitVector b1,
BitVector b2)
Return a new bit string as the AND of two others. |
void |
clear(int bit)
Clears a bit. |
void |
clearAll()
Clears all bits. |
void |
copyBits(BitVector set)
Copies the values of the bits in the specified set into this set. |
BitVector |
dup()
|
boolean |
equals(Object obj)
Compares this object against the specified object. |
boolean |
get(int bit)
Gets a bit. |
int |
hashCode()
Gets the hashcode. |
boolean |
intersectionEmpty(BitVector other)
Check if the intersection of the two sets is empty |
boolean |
isZero()
|
int |
length()
Calculates and returns the set's size in bits. |
void |
not()
Logically NOT this bit string |
static BitVector |
not(BitVector s)
Return the NOT of a bit string |
void |
or(BitVector set)
Logically ORs this bit set with the specified set of bits. |
static BitVector |
or(BitVector b1,
BitVector b2)
Return a new BitVector as the OR of two others |
int |
populationCount()
How many bits are set? |
void |
set(int bit)
Sets a bit. |
void |
setAll()
Sets all bits. |
private static int |
subscript(int bitIndex)
Convert bitIndex to a subscript into the bits[] array. |
String |
toString()
Converts the BitVector to a String. |
void |
xor(BitVector set)
Logically XORs this bit set with the specified set of bits. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static final long serialVersionUID
private static final int LOG_BITS_PER_UNIT
private static final int MASK
private static final int LOW_MASK
private final int[] bits
private final int nbits
| Constructor Detail |
|---|
public BitVector(int nbits)
nbits - the size of the stringpublic BitVector(BitVector s)
s - the string to copy| Method Detail |
|---|
private static int subscript(int bitIndex)
public void setAll()
public void set(int bit)
bit - the bit to be setpublic void clearAll()
public void clear(int bit)
bit - the bit to be clearedpublic boolean get(int bit)
bit - the bit to be gottenpublic void not()
public static BitVector not(BitVector s)
public void and(BitVector set)
set - the bit set to be ANDed with
public static BitVector and(BitVector b1,
BitVector b2)
public void or(BitVector set)
set - the bit set to be ORed with
public static BitVector or(BitVector b1,
BitVector b2)
public void xor(BitVector set)
set - the bit set to be XORed withpublic boolean intersectionEmpty(BitVector other)
other - the set to check intersection withpublic void copyBits(BitVector set)
set - the bit set to copy the bits frompublic int hashCode()
hashCode in class Objectpublic int populationCount()
public int length()
public boolean equals(Object obj)
equals in class Objectobj - the object to compare with
public boolean isZero()
public BitVector dup()
public String toString()
toString in class Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||