public interface ChronicleBitSet extends Marshallable, net.openhft.chronicle.core.io.Closeable
| Modifier and Type | Field and Description |
|---|---|
static long |
BITS_PER_WORD |
EMPTYDISCARD| Modifier and Type | Method and Description |
|---|---|
void |
and(ChronicleBitSet bitSet) |
void |
andNot(ChronicleBitSet bitSet) |
int |
cardinality() |
void |
clear()
Sets all the bits in this ChronicleBitSet to
false. |
void |
clear(int bitIndex)
Sets the bit specified by the index to
false. |
void |
clear(int fromIndex,
int toIndex) |
void |
copyFrom(ChronicleBitSet bitSet) |
void |
flip(int index) |
void |
flip(int fromIndex,
int toIndex) |
boolean |
get(int bitIndex)
Returns the value of the bit with the specified index.
|
long |
getWord(int wordIndex) |
int |
getWordsInUse() |
boolean |
intersects(ChronicleBitSet bitSet) |
default boolean |
isEmpty() |
default int |
length()
Returns the "logical size" of this
ChronicleBitSet: the index of the highest set bit in the ChronicleBitSet plus one. |
int |
nextClearBit(int index) |
int |
nextSetBit(int fromIndex) |
int |
nextSetBit(int fromIndex,
int toIndex)
Returns the index of the first bit that is set to
true that occurs on or after the specified starting index. |
void |
or(ChronicleBitSet bitSet) |
void |
set(int bitIndex)
Sets the bit at the specified index to
true. |
default void |
set(int bitIndex,
boolean value)
Sets the bit at the specified index to the specified value.
|
void |
set(int fromIndex,
int toIndex) |
default void |
set(int fromIndex,
int toIndex,
boolean value)
Sets the bits from the specified
fromIndex (inclusive) to the specified toIndex (exclusive) to the specified value. |
void |
setWord(int wordIndex,
long bits) |
int |
size()
Returns the number of bits of space actually in use by this
ChronicleBitSet to represent bit values. |
void |
xor(ChronicleBitSet bitSet) |
$equals, $fieldInfoMap, $fieldInfos, $hashCode, $toString, className, copyTo, deepCopy, fromFile, fromFile, fromString, fromString, fromString, getField, getLongField, mergeToMap, readMarshallable, reset, setField, setLongField, streamFromFile, streamFromFile, writeMarshallablebinaryLengthLength, writeValueunexpectedFieldusesSelfDescribingMessagestatic final long BITS_PER_WORD
int size()
ChronicleBitSet to represent bit values.
The maximum element in the set is the size - 1st element.void set(int bitIndex)
true.bitIndex - a bit indexIndexOutOfBoundsException - if the specified index is negativedefault void set(int bitIndex,
boolean value)
bitIndex - a bit indexvalue - a boolean value to setIndexOutOfBoundsException - if the specified index is negativevoid set(int fromIndex,
int toIndex)
default void set(int fromIndex,
int toIndex,
boolean value)
fromIndex (inclusive) to the specified toIndex (exclusive) to the specified value.fromIndex - index of the first bit to be settoIndex - index after the last bit to be setvalue - value to set the selected bits toIndexOutOfBoundsException - if fromIndex is negative, or toIndex is negative,
or fromIndex is larger than toIndexboolean get(int bitIndex)
true if the bit with the index bitIndex is currently set in
this ChronicleBitSet; otherwise, the result is false.bitIndex - the bit indexIndexOutOfBoundsException - if the specified index is negativevoid clear(int bitIndex)
false.bitIndex - the index of the bit to be clearedIndexOutOfBoundsException - if the specified index is negativeint nextSetBit(int fromIndex,
int toIndex)
true that occurs on or after the specified starting index. If no such bit exists then
-1 is returned.
To iterate over the true bits in a ChronicleBitSet,
use the following loop:
for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i+1,to)) {
// operate on index i here
if (i == Integer.MAX_VALUE) {
break; // or (i+1) would overflow
}
}fromIndex - the index to start checking from (inclusive)toIndex - (inclusive) returns -1 if a bit is not found before this value-1 if there is no such bitIndexOutOfBoundsException - if the specified index is negativeint nextSetBit(int fromIndex)
void clear()
false.default boolean isEmpty()
default int length()
ChronicleBitSet: the index of the highest set bit in the ChronicleBitSet plus one.
Returns zero if the ChronicleBitSet contains no set bits.ChronicleBitSetint cardinality()
int nextClearBit(int index)
void flip(int index)
void flip(int fromIndex,
int toIndex)
void clear(int fromIndex,
int toIndex)
int getWordsInUse()
long getWord(int wordIndex)
void setWord(int wordIndex,
long bits)
void andNot(ChronicleBitSet bitSet)
void and(ChronicleBitSet bitSet)
void xor(ChronicleBitSet bitSet)
void or(ChronicleBitSet bitSet)
boolean intersects(ChronicleBitSet bitSet)
void copyFrom(ChronicleBitSet bitSet)
Copyright © 2023. All rights reserved.