|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.util.BitVector
public class BitVector
BitVector
This class implements vectors of bits and the operations needed to use them. The vectors can be of arbitrary length. The operations provided are all the binary operations available to the int and long primitive types in Java.
All bit operations are present in two forms: a normal form and a self form. The normal form returns a newly created object containing the result, while the self form puts the result in the calling object (this). The return value of the self form is the calling object itself. This is done to allow easier manipulation of the results, making it possible to chain operations.
Constructor Summary | |
---|---|
BitVector(BitVector that)
. |
|
BitVector(int length)
. |
|
BitVector(int[] vect)
. |
|
BitVector(int[] vect,
int length)
. |
Method Summary | |
---|---|
BitVector |
and(BitVector that)
. |
Object |
clone()
. |
void |
enlarge(int size)
. |
void |
enlarge(int size,
boolean filling)
. |
boolean |
equals(BitVector that)
. |
boolean |
getBool(int pos)
. |
int |
getInt(int pos)
. |
BitVector |
not()
. |
BitVector |
or(BitVector that)
. |
boolean |
scalarProduct(BitVector that)
. |
BitVector |
selfAnd(BitVector that)
. |
BitVector |
selfNot()
. |
BitVector |
selfOr(BitVector that)
. |
BitVector |
selfShift(int j)
. |
BitVector |
selfXor(BitVector that)
. |
void |
setBool(int pos,
boolean value)
. |
BitVector |
shift(int j)
. |
int |
size()
. |
String |
toString()
. |
BitVector |
xor(BitVector that)
. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BitVector(int length)
public BitVector(int[] vect, int length)
public BitVector(int[] vect)
public BitVector(BitVector that)
Method Detail |
---|
public Object clone()
clone
in class Object
public boolean equals(BitVector that)
public int size()
public void enlarge(int size, boolean filling)
public void enlarge(int size)
public boolean getBool(int pos)
public void setBool(int pos, boolean value)
public int getInt(int pos)
public String toString()
toString
in class Object
public BitVector not()
public BitVector selfNot()
public BitVector xor(BitVector that)
public BitVector selfXor(BitVector that)
public BitVector and(BitVector that)
public BitVector selfAnd(BitVector that)
public BitVector or(BitVector that)
public BitVector selfOr(BitVector that)
public BitVector shift(int j)
public BitVector selfShift(int j)
public boolean scalarProduct(BitVector that)
|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |