|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.data.vector.bitvector.SparseBitVectorCellFactory
public class SparseBitVectorCellFactory
Constructor Summary | |
---|---|
SparseBitVectorCellFactory(long length)
Initializes the factory to the specified length, all bits cleared. |
|
SparseBitVectorCellFactory(long length,
int initialCapacity)
Initializes the factory to the specified length, all bits cleared. |
|
SparseBitVectorCellFactory(long length,
long[] oneIdxs)
Initializes the factory to the specified length, all bits whose index appear in the passed array are set. |
|
SparseBitVectorCellFactory(SparseBitVector vector)
A copy of the specified vector is stored in the created bit vector cell. |
|
SparseBitVectorCellFactory(SparseBitVectorCell cell,
long startIdx,
long endIdx)
Initializes the vector from a subsequence of the specified cell. |
|
SparseBitVectorCellFactory(String hexString)
Initializes the created bit vector from the hex representation in the passed string. |
Method Summary | |
---|---|
static SparseBitVectorCell |
and(BitVectorValue bv1,
BitVectorValue bv2)
Creates a sparse bit vector cell containing the result of the AND operation on the passed operands. |
void |
clear(long bitIndex)
Clears the bit with the specified index in the vector. |
SparseBitVectorCell |
createDataCell()
Creates a DataCell from the currently stored bit vector. |
static SparseBitVectorCell |
or(BitVectorValue bv1,
BitVectorValue bv2)
Creates a sparse bit vector cell containing the result of the OR operation on the passed operands. |
void |
set(long bitIndex)
Sets the bit with the specified index in the vector. |
void |
set(long bitIdx,
boolean value)
Sets the bit at the specified index to the new value. |
static SparseBitVectorCell |
xor(BitVectorValue bv1,
BitVectorValue bv2)
Creates a sparse bit vector cell containing the result of the XOR operation on the passed operands. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SparseBitVectorCellFactory(long length)
length
- of the vector in the cell to createpublic SparseBitVectorCellFactory(long length, int initialCapacity)
length
- of the vector in the cell to createinitialCapacity
- the number of expected '1's in the vectorpublic SparseBitVectorCellFactory(long length, long[] oneIdxs)
length
- of the vector in the cell to createoneIdxs
- the array containing the indices of the ones. Should be
sorted (lowest index first).public SparseBitVectorCellFactory(SparseBitVector vector)
vector
- used to initialize the bits.public SparseBitVectorCellFactory(SparseBitVectorCell cell, long startIdx, long endIdx)
startIdx
to endIdx - 1
.
The length of the resulting vector is startIdx - endIdx
.
cell
- the bit vector cell to take the subsequence from.startIdx
- the first bit to include in the created bit vectorendIdx
- the first bit NOT to include in the result vectorpublic SparseBitVectorCellFactory(String hexString)
'0' - '9'
and
'A' - 'F'
are allowed. The character at string position
(length - 1)
represents the bits with index 0 to 3 in the
vector. The character at position 0 represents the bits with the highest
indices. The length of the vector created is the length of the string
times 4 (as each character represents four bits).
hexString
- containing the hex value to initialize the vector with
IllegalArgumentException
- if hexString
contains
characters other then the hex characters (i.e.
0 - 9, A - F
)Method Detail |
---|
public void set(long bitIndex)
bitIndex
- the index of the bit to set to one.public void set(long bitIdx, boolean value)
bitIdx
- the index of the bit to set or clearvalue
- if true, the specified bit will be set, otherwise it will be
cleared.
ArrayIndexOutOfBoundsException
- if the index is negative or larger
than the size of the vectorpublic void clear(long bitIndex)
bitIndex
- the index of the bit to set to zero.public SparseBitVectorCell createDataCell()
DataCell
from the currently stored bit vector.
DataCell
containing the current value of the vectorpublic static SparseBitVectorCell and(BitVectorValue bv1, BitVectorValue bv2)
SparseBitVectorCell
s. All other implementations need to access
the bits through get/set methods which probably performs very poorly.
DenseBitVectorCellFactory.and(BitVectorValue, BitVectorValue)
for ANDing dense bit vector cells.
bv1
- the first operand to AND with the otherbv2
- the other operand to AND with the first one
public static SparseBitVectorCell or(BitVectorValue bv1, BitVectorValue bv2)
SparseBitVectorCell
s. All other implementations need to access
the bits through get/set methods which probably performs very poorly.
DenseBitVectorCellFactory.and(BitVectorValue, BitVectorValue)
for ORing dense bit vector cells.
bv1
- the first operand to OR with the otherbv2
- the other operand to OR with the first one
public static SparseBitVectorCell xor(BitVectorValue bv1, BitVectorValue bv2)
SparseBitVectorCell
s. All other implementations need to access
the bits through get/set methods which probably performs very poorly.
DenseBitVectorCellFactory.and(BitVectorValue, BitVectorValue)
for XORing dense bit vector cells.
bv1
- the first operand to XOR with the otherbv2
- the other operand to XOR with the first one
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |