|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.data.vector.bitvector.DenseBitVectorCellFactory
public class DenseBitVectorCellFactory
Used to created DataCell
s holding a DenseBitVector
. As data
cells are read only this factory can be used to initialize the bit vector
accordingly and then create a data cell from it.
This factory also provides methods for performing basic operations
(and(BitVectorValue, BitVectorValue)
,
or(BitVectorValue, BitVectorValue)
, etc.) on two data cells holding
bit vectors.
Constructor Summary | |
---|---|
DenseBitVectorCellFactory(DenseBitVector vector)
A copy of the specified vector is stored in the created bit vector cell. |
|
DenseBitVectorCellFactory(DenseBitVectorCell cell,
long startIdx,
long endIdx)
Initializes the vector from a subsequence of the specified cell. |
|
DenseBitVectorCellFactory(long length)
Initializes the factory to the specified length, all bits cleared. |
|
DenseBitVectorCellFactory(long[] bits,
long length)
Initializes the factory to the specified length, initializing the bits from the passed array. |
|
DenseBitVectorCellFactory(String hexString)
Initializes the created bit vector from the hex representation in the passed string. |
Method Summary | |
---|---|
static DenseBitVectorCell |
and(BitVectorValue bv1,
BitVectorValue bv2)
Creates a dense 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. |
DenseBitVectorCell |
createDataCell()
Creates a DataCell from the currently stored bit vector. |
static DenseBitVectorCell |
or(BitVectorValue bv1,
BitVectorValue bv2)
Creates a dense 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. |
void |
set(long startIdx,
long endIdx)
Sets all bits in the specified range. |
static SparseBitVectorCell |
xor(BitVectorValue bv1,
BitVectorValue bv2)
Creates a dense 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 DenseBitVectorCellFactory(long length)
length
- of the vector in the cell to createpublic DenseBitVectorCellFactory(long[] bits, long length)
DenseBitVector.getAllBits()
method.
bits
- the array containing the initial values of the vectorlength
- the number of bits to use from the array. If the array is
too long (i.e. contains more than length bits) the additional
bits are ignored. If the array is too short, an exception is
thrown.
IllegalArgumentException
- if length is negative or MAX_VALUE, or
if the length of the argument array is less than (length - 1)
>> 6) + 1public DenseBitVectorCellFactory(DenseBitVector vector)
vector
- used to initialize the bits.public DenseBitVectorCellFactory(DenseBitVectorCell 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 DenseBitVectorCellFactory(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 startIdx, long endIdx)
startIdx
- the index of the first bit to set to oneendIdx
- the index of the last bit to set to onepublic 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 DenseBitVectorCell createDataCell()
DataCell
from the currently stored bit vector.
DataCell
containing the current value of the vectorpublic static DenseBitVectorCell and(BitVectorValue bv1, BitVectorValue bv2)
DenseBitVectorCell
s. All other implementations need to access
the bits through get/set methods which probably performs very poorly.
SparseBitVectorCellFactory.and(BitVectorValue, BitVectorValue)
for ANDing sparse bit vector cells.
bv1
- the first operand to AND with the otherbv2
- the other operand to AND with the first one
public static DenseBitVectorCell or(BitVectorValue bv1, BitVectorValue bv2)
DenseBitVectorCell
s. All other implementations need to access
the bits through get/set methods which probably performs very poorly.
SparseBitVectorCellFactory.and(BitVectorValue, BitVectorValue)
for ORing sparse 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.
SparseBitVectorCellFactory.and(BitVectorValue, BitVectorValue)
for XORing sparse 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 |