|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Object | +--coins.alias.util.BitVector
BitVector class:
Unlike java.util.BitSet class, this class offers
methods for non-destructive bit operations, where the result
of the operation will be stored in the last argument of
such methods.
| フィールドの概要 | |
protected int |
fBitLength
Length of this BitVector. |
protected int |
fLongWordLength
Length of the long array that internally holds data. |
protected static int |
fShiftMax
Maximum possible shift of bits within a long word, or 63. |
protected long[] |
fVectorWord
Array of longs that internally holds data. |
| コンストラクタの概要 | |
BitVector(int pBitLength)
Creates an instance of BitVector with the specified length. |
|
| メソッドの概要 | |
BitVectorIterator |
bitVectorIterator()
Returns the BitVectorIterator that is backed by
this BitVector. |
boolean |
equals(java.lang.Object pObject)
The equality for two BitVector objects is specified
by vectorEqual |
int |
getBit(int pInx)
Returns bit state at the specified position. |
int |
getBitLength()
Returns the length of this BitVector. |
long[] |
getVectorWord()
Returns the long array that internally holds data for this BitVector. |
int |
getWordLength()
Returns the length of the long array that internally
holds data for this BitVector. |
boolean |
isSet(int pInx)
Queries if the specified bit is set. |
boolean |
isZero()
Queries if all the bits of this BitVector's is unset. |
void |
resetBit(int pInx)
Resets bit at the specified position. |
void |
setBit(int pInx)
Sets bit at the specified position. |
java.lang.String |
toString()
Returns a String representation of this
BitVector. |
java.lang.String |
toStringDescriptive()
Returns a String representation of this
BitVector, which is at least as descriptive
as the one returned by toString(). |
BitVector |
vectorAnd(BitVector pOperand2,
BitVector pResult)
Performs the bitwise AND operation between this BitVector
and the argument pOperand2, and stores the result
into pResult. |
BitVector |
vectorCopy(BitVector pResult)
Copies the contents of this BitVector into
the specified argument. |
boolean |
vectorEqual(BitVector pOperand2)
Compares this BitVector with the specified
argument for equality. |
BitVector |
vectorNot(BitVector pResult)
Performs the bitwise NOT operation on this BitVector
and store the result into the specified argument. |
BitVector |
vectorOr(BitVector pOperand2,
BitVector pResult)
Performs the bitwise OR operation between this BitVector
and the argument pOperand2, and stores the result
into pResult. |
BitVector |
vectorReset()
Resets all the bits of this BitVector. |
BitVector |
vectorSub(BitVector pOperand2,
BitVector pResult)
Performs the bitwise subtraction operation between this BitVector and the argument pOperand2,
and stores the result into pResult.
|
BitVector |
vectorXor(BitVector pOperand2,
BitVector pResult)
Performs the bitwise exclusive OR (XOR) operation between this BitVector and the argument
pOperand2, and stores the result into
pResult. |
| クラス java.lang.Object から継承したメソッド |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| フィールドの詳細 |
protected final long[] fVectorWord
longs that internally holds data.
protected final int fLongWordLength
long array that internally holds data.
protected final int fBitLength
BitVector.
protected static final int fShiftMax
long word, or 63.
| コンストラクタの詳細 |
public BitVector(int pBitLength)
BitVector with the specified length.
pBitLength - the length of the BitVector| メソッドの詳細 |
public void setBit(int pInx)
pInx - the index (position) of the bit to be set.public void resetBit(int pInx)
pInx - the index (position) of the bit to be reset.public int getBit(int pInx)
pInx - the index (position) of the bit to get.
public boolean isSet(int pInx)
pInx - the index (position) of the bit to query.
public boolean isZero()
BitVector's is unset.
public int getBitLength()
BitVector.
BitVector.public long[] getVectorWord()
long array that internally holds data for this BitVector.
long array that internally holds data.public int getWordLength()
long array that internally
holds data for this BitVector.
long array that internally
holds data.public BitVectorIterator bitVectorIterator()
BitVectorIterator that is backed by
this BitVector.
BitVectorIterator that is backed by
this BitVector.public BitVector vectorNot(BitVector pResult)
BitVector
and store the result into the specified argument. The argument
must have the same length as this BitVector.
pResult - the BitVector where the result of
the NOT operation is stored.
pResult, the result of the NOT operation.
public BitVector vectorAnd(BitVector pOperand2,
BitVector pResult)
BitVector
and the argument pOperand2, and stores the result
into pResult. Both pOperand2 and
pResult must have the same length as this
BitVector.
pOperand2 - the BitVector with which this
BitVector is ANDed.pResult - the BitVector where the result of
the AND operation is stored.
pResult, the result of the AND operation.
public BitVector vectorOr(BitVector pOperand2,
BitVector pResult)
BitVector
and the argument pOperand2, and stores the result
into pResult. Both pOperand2 and
pResult must have the same length as this
BitVector.
pOperand2 - the BitVector with which this
BitVector is ORed.pResult - the BitVector where the result
of the OR operation is stored.
pResult, the result of the OR operation.
public BitVector vectorXor(BitVector pOperand2,
BitVector pResult)
BitVector and the argument
pOperand2, and stores the result into
pResult. Both pOperand2 and
pResult must have the same length as this
BitVector.
pOperand2 - the BitVector with which
this BitVector is XORed.pResult - the BitVector where the
result of the XOR operation is stored.
pResult, the result of the XOR operation.
public BitVector vectorSub(BitVector pOperand2,
BitVector pResult)
BitVector and the argument pOperand2,
and stores the result into pResult.
Both pOperand2 and pResult must
have the same length as this BitVector.
pOperand2 - the BitVector by which amount
this BitVector is reduced (the second operand
of the bitwise subtraction operation).pResult - the BitVector where the result
of the subtraction operation is stored.
pResult, the result of the subtraction
operation.public BitVector vectorCopy(BitVector pResult)
BitVector into
the specified argument. The argument must have the same
length as this BitVector.
pResult - the destination of the copy operation.
pResult, the result of the copy operation.public boolean vectorEqual(BitVector pOperand2)
BitVector with the specified
argument for equality. Two BitVectors are equal
when they have the same contents (bit sequences). The argument
must have the same length as this BitVector.
pOperand2 - the BitVector to be compared
with this BitVector.
BitVector
and those of the argument are equal.public boolean equals(java.lang.Object pObject)
BitVector objects is specified
by vectorEqual(). This method returns true if and
only if the specified argument pObject is an
instance of BitVector, its length is equal to
the length of this BitVector, and
vectorEqual((BitVector)pObject) returns true.
- オーバーライド:
- クラス
java.lang.Object 内の equals
- パラメータ:
pObject - the object to be compared with this
BitVector.
- 戻り値:
- true if the specified argument
pObject
is a BitVector having the same length as this
one and vectorEqual((BitVector)pObject) returns true. - 関連項目:
vectorEqual(coins.alias.util.BitVector)
public BitVector vectorReset()
BitVector.
BitVector with all the bits reset.public java.lang.String toString()
String representation of this
BitVector. The resultant String
contains the bit positions of the set bits separated by spaces.
java.lang.Object 内の toStringString representation of this
BitVector.public java.lang.String toStringDescriptive()
String representation of this
BitVector, which is at least as descriptive
as the one returned by toString(). It should
usually contain the String representation of
the objects that are associated with the set bits.
This method returns the same String as
toString() for this class.
- 戻り値:
- the
String representation of this
BitVector that is possibly more detailed than that
returned by toString.
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||