|
Evolvica Core API Version 0.6.2 Last Modified: June 29 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.evolvica.util.BitVector
Replacement for Sun's unflexible BitSet.
Constructor Summary | |
BitVector()
Constructor. |
|
BitVector(BitVector bv)
Copy Constructor. |
|
BitVector(int length)
Constructor. |
|
BitVector(java.lang.String pattern)
Constructs a bit vector from a given string pattern. |
Method Summary | |
BitVector |
and(BitVector bv)
Performs an AND conjunction. |
void |
clear(int index)
Clears the bit at the given index. |
java.lang.Object |
clone()
|
boolean |
get(int index)
Returns the bit at the given position. |
int |
getAsInteger(int index)
Returns the value of the bit at the given position as an integer. |
void |
invert()
Inverts the whole vector. |
int |
length()
Returns the length of the bit vector. |
BitVector |
or(BitVector bv)
Performs an OR function. |
void |
randomize()
Randomizes the bitstring. |
void |
set(int index)
Sets the bit at the given index to true. |
void |
set(int index,
boolean value)
Sets the bit at the given index to the given value. |
void |
shiftLeft()
Performs a shift left. |
void |
shiftLeft(int amount)
Performs a shift left by the specified amount. |
void |
shiftRight()
Performs a shift right. |
void |
shiftRight(int amount)
Performs a shift right by the specified amount. |
java.lang.String |
toBlockString()
Returns the bit vector as blocks of 8 bits. |
java.lang.String |
toBlockString(int blockLength)
Returns the bit vector as blocks of the given block length. |
void |
toggle(int index)
Toggles the bit at the given index. |
java.lang.String |
toString()
Returns a string representation of the bit vector. |
BitVector |
xor(BitVector bv)
Performs a XOR function. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public BitVector()
public BitVector(int length)
length
- length of the bit vector, must be greater than 0public BitVector(BitVector bv)
bv
- bit vector to be copiedpublic BitVector(java.lang.String pattern)
pattern
- string patternMethod Detail |
public BitVector and(BitVector bv)
bv
- second bit vector
public void clear(int index)
index
- index of the bitpublic java.lang.Object clone()
Object.clone()
public boolean get(int index)
index
- index of the bit
public int getAsInteger(int index)
index
- index of the bit
public void invert()
public int length()
public BitVector or(BitVector bv)
bv
- second bit vector
public void randomize()
public void set(int index)
index
- index of the bitpublic void set(int index, boolean value)
index
- index of the bitvalue
- value to setpublic void shiftLeft()
public void shiftLeft(int amount)
amount
- amount to shiftpublic void shiftRight()
public void shiftRight(int amount)
amount
- amount to shiftpublic java.lang.String toBlockString()
public java.lang.String toBlockString(int blockLength)
blockLength
- block length
public void toggle(int index)
index
- position of the bit in bit vectorpublic java.lang.String toString()
public BitVector xor(BitVector bv)
bv
- second bit vector
|
Evolvica Core API Version 0.6.2 Last Modified: June 29 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |