Class BitVector
- java.lang.Object
-
- org.apache.ignite.internal.processors.query.stat.hll.util.BitVector
-
-
Field Summary
Fields Modifier and Type Field Description static intBITS_PER_BYTEBits per byte.static intBYTES_PER_WORDBytes per word.
-
Constructor Summary
Constructors Constructor Description BitVector(int width, long count)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intbyteCount()BitVectorclone()Creates a deep copy of this vector.voidfill(long val)Fills this bit vector with the specified bit value.longgetRegister(long registerIndex)voidgetRegisterContents(IWordSerializer serializer)Serializes the registers of the vector using the specified serializer.LongIteratorregisterIterator()intregisterWidth()booleansetMaxRegister(long registerIndex, long value)Sets the value of the specified index register if and only if the specified value is greater than the current value in the register.voidsetRegister(long registerIndex, long value)intwordCount()long[]words()
-
-
-
Field Detail
-
BITS_PER_BYTE
public static final int BITS_PER_BYTE
Bits per byte.- See Also:
- Constant Field Values
-
BYTES_PER_WORD
public static final int BYTES_PER_WORD
Bytes per word.- See Also:
- Constant Field Values
-
-
Method Detail
-
words
public final long[] words()
-
wordCount
public final int wordCount()
-
byteCount
public final int byteCount()
-
registerWidth
public final int registerWidth()
-
getRegister
public long getRegister(long registerIndex)
- Parameters:
registerIndex- the index of the register whose value is to be retrieved. This cannot be negative.- Returns:
- the value at the specified register index
- See Also:
setRegister(long, long),setMaxRegister(long, long)
-
setRegister
public void setRegister(long registerIndex, long value)- Parameters:
registerIndex- the index of the register whose value is to be set. This cannot be negativevalue- the value to set in the register- See Also:
getRegister(long),setMaxRegister(long, long)
-
registerIterator
public LongIterator registerIterator()
- Returns:
- a
LongIteratorfor iterating starting at the register with index zero. This will never benull.
-
setMaxRegister
public boolean setMaxRegister(long registerIndex, long value)Sets the value of the specified index register if and only if the specified value is greater than the current value in the register. This is equivalent to but much more performant than:vector.setRegister(index, Math.max(vector.getRegister(index), value));
- Parameters:
registerIndex- the index of the register whose value is to be set. This cannot be negativevalue- the value to set in the register if and only if this value is greater than the current value in the register- Returns:
trueif and only if the specified value is greater than or equal to the current register value.falseotherwise.- See Also:
getRegister(long),setRegister(long, long),Math.max(long, long)
-
fill
public void fill(long val)
Fills this bit vector with the specified bit value. This can be used to clear the vector by specifying0.- Parameters:
val- the value to set all bits to (only the lowest bit is used)
-
getRegisterContents
public void getRegisterContents(IWordSerializer serializer)
Serializes the registers of the vector using the specified serializer.- Parameters:
serializer- the serializer to use. This cannot benull.
-
clone
public BitVector clone()
Creates a deep copy of this vector.- Overrides:
clonein classObject- See Also:
Object.clone()
-
-