public final class ConcurrentFlatBitSetFrame extends Object implements BitSetFrame
BitSetFrame.BitsNOT_FOUND| Constructor and Description |
|---|
ConcurrentFlatBitSetFrame(long logicalSize) |
| Modifier and Type | Method and Description |
|---|---|
BitSetAlgorithm |
algorithm() |
<T> long |
cardinality(Access<T> access,
T handle,
long offset)
Returns the number of bits set to
true in the bit set. |
<T> void |
clear(Access<T> access,
T handle,
long offset,
long bitIndex)
Sets the bit specified by the index to
false. |
<T> void |
clearAll(Access<T> access,
T handle,
long offset)
Equivalent to
clearRange(0, logicalSize()). |
<T> boolean |
clearIfSet(Access<T> access,
T handle,
long offset,
long bitIndex)
Clears the bit at the specified index (sets it to
false). |
<T> long |
clearNextNContinuousSetBits(Access<T> access,
T handle,
long offset,
long fromIndex,
int numberOfBits)
WARNING! This implementation doesn't strictly follow the contract
from
BitSetFrame interface. |
<T> long |
clearNextSetBit(Access<T> access,
T handle,
long offset,
long fromIndex)
Finds and clears the first bit that is set to
true
that occurs on or after the specified starting index. |
<T> long |
clearPreviousNContinuousSetBits(Access<T> access,
T handle,
long offset,
long fromIndex,
int numberOfBits)
WARNING! This implementation doesn't strictly follow the contract
from
DirectBitSet interface. |
<T> long |
clearPreviousSetBit(Access<T> access,
T handle,
long offset,
long fromIndex)
Finds and clears the nearest bit that is set to
true
that occurs on or before the specified starting index. |
<T> void |
clearRange(Access<T> access,
T handle,
long offset,
long fromIndex,
long exclusiveToIndex)
Sets the bits from the specified
fromIndex (inclusive) to the
specified toIndex (exclusive) to false. |
<T> void |
flip(Access<T> access,
T handle,
long offset,
long bitIndex)
Sets the bit at the specified index to the complement of its
current value.
|
<T> void |
flipRange(Access<T> access,
T handle,
long offset,
long fromIndex,
long exclusiveToIndex)
Sets each bit from the specified
fromIndex (inclusive) to the
specified toIndex (exclusive) to the complement of its current
value. |
<T> boolean |
get(Access<T> access,
T handle,
long offset,
long bitIndex)
Returns the value of the bit with the specified index.
|
<T> boolean |
isRangeClear(Access<T> access,
T handle,
long offset,
long fromIndex,
long toIndex)
Checks if each bit from the specified
fromIndex (inclusive) to the specified exclusiveToIndex is set to false. |
<T> boolean |
isRangeSet(Access<T> access,
T handle,
long offset,
long fromIndex,
long toIndex)
Checks if each bit from the specified
fromIndex (inclusive) to the specified exclusiveToIndex is set to true. |
long |
logicalSize()
Number of bits in this frame.
|
<T> long |
nextClearBit(Access<T> access,
T handle,
long offset,
long fromIndex)
Returns the index of the first bit that is set to
false
that occurs on or after the specified starting index. |
<T> long |
nextSetBit(Access<T> access,
T handle,
long offset,
long fromIndex)
Returns the index of the first bit that is set to
true
that occurs on or after the specified starting index. |
<T> long |
previousClearBit(Access<T> access,
T handle,
long offset,
long fromIndex)
Returns the index of the nearest bit that is set to
false
that occurs on or before the specified starting index. |
<T> long |
previousSetBit(Access<T> access,
T handle,
long offset,
long fromIndex)
Returns the index of the nearest bit that is set to
true
that occurs on or before the specified starting index. |
<T> void |
set(Access<T> access,
T handle,
long offset,
long bitIndex)
Sets the bit at the specified index to
true. |
<T> void |
setAll(Access<T> access,
T handle,
long offset)
Equivalent to
setRange(0, logicalSize()). |
BitSetFrame.Bits |
setBits()
Returns an iteration of set bits in direct order
(from 0 to the end of the bit set).
|
<T> boolean |
setIfClear(Access<T> access,
T handle,
long offset,
long bitIndex)
Sets the bit at the specified index to
true. |
<T> long |
setNextClearBit(Access<T> access,
T handle,
long offset,
long fromIndex)
Finds and sets to
true the first bit that is set to false
that occurs on or after the specified starting index. |
<T> long |
setNextNContinuousClearBits(Access<T> access,
T handle,
long offset,
long fromIndex,
int numberOfBits)
WARNING! This implementation doesn't strictly follow the contract
from
DirectBitSet interface. |
<T> long |
setPreviousClearBit(Access<T> access,
T handle,
long offset,
long fromIndex)
Finds and sets to
true the nearest bit that is set
to false that occurs on or before the specified starting index. |
<T> long |
setPreviousNContinuousClearBits(Access<T> access,
T handle,
long offset,
long fromIndex,
int numberOfBits)
WARNING! This implementation doesn't strictly follow the contract
from
DirectBitSet interface. |
<T> void |
setRange(Access<T> access,
T handle,
long offset,
long fromIndex,
long exclusiveToIndex)
Sets the bits from the specified
fromIndex (inclusive) to the
specified toIndex (exclusive) to true. |
long |
sizeInBytes()
Number of bytes taken by this frame.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisClear, isSet, set, setRangepublic <T> void flip(Access<T> access, T handle, long offset, long bitIndex)
BitSetFrameflip in interface BitSetFramebitIndex - the index of the bit to flippublic <T> void flipRange(Access<T> access, T handle, long offset, long fromIndex, long exclusiveToIndex)
BitSetFramefromIndex (inclusive) to the
specified toIndex (exclusive) to the complement of its current
value.flipRange in interface BitSetFramefromIndex - index of the first bit to flipexclusiveToIndex - index after the last bit to flippublic <T> void set(Access<T> access, T handle, long offset, long bitIndex)
BitSetFrametrue.set in interface BitSetFramebitIndex - the bit indexpublic <T> boolean setIfClear(Access<T> access, T handle, long offset, long bitIndex)
BitSetFrametrue.setIfClear in interface BitSetFramebitIndex - the bit indextrue if the bit was zeroOut, or false if the bit was already setpublic <T> void setRange(Access<T> access, T handle, long offset, long fromIndex, long exclusiveToIndex)
BitSetFramefromIndex (inclusive) to the
specified toIndex (exclusive) to true.setRange in interface BitSetFramefromIndex - index of the first bit to be setexclusiveToIndex - index after the last bit to be setpublic <T> void setAll(Access<T> access, T handle, long offset)
BitSetFramesetRange(0, logicalSize()).setAll in interface BitSetFramepublic <T> void clear(Access<T> access, T handle, long offset, long bitIndex)
BitSetFramefalse.clear in interface BitSetFramebitIndex - the index of the bit to be clearedpublic <T> boolean clearIfSet(Access<T> access, T handle, long offset, long bitIndex)
BitSetFramefalse).clearIfSet in interface BitSetFramebitIndex - a bit indexpublic <T> void clearRange(Access<T> access, T handle, long offset, long fromIndex, long exclusiveToIndex)
BitSetFramefromIndex (inclusive) to the
specified toIndex (exclusive) to false.clearRange in interface BitSetFramefromIndex - index of the first bit to be clearedexclusiveToIndex - index after the last bit to be clearedpublic <T> void clearAll(Access<T> access, T handle, long offset)
BitSetFrameclearRange(0, logicalSize()).clearAll in interface BitSetFramepublic <T> boolean get(Access<T> access, T handle, long offset, long bitIndex)
BitSetFrametrue if the bit with the index bitIndex
is currently set in this DirectBitSet; otherwise, the result
is false.get in interface BitSetFramebitIndex - the bit indexpublic <T> boolean isRangeSet(Access<T> access, T handle, long offset, long fromIndex, long toIndex)
BitSetFramefromIndex (inclusive) to the specified exclusiveToIndex is set to true.isRangeSet in interface BitSetFramefromIndex - index of the first bit to checktoIndex - index after the last bit to checktrue if all bits in the specified range are set to true,
false otherwisepublic <T> boolean isRangeClear(Access<T> access, T handle, long offset, long fromIndex, long toIndex)
BitSetFramefromIndex (inclusive) to the specified exclusiveToIndex is set to false.isRangeClear in interface BitSetFramefromIndex - index of the first bit to checktoIndex - index after the last bit to checktrue if all bits in the specified range are set to false,
false otherwisepublic <T> long nextSetBit(Access<T> access, T handle, long offset, long fromIndex)
BitSetFrametrue
that occurs on or after the specified starting index. If no such
bit exists then -1 is returned.nextSetBit in interface BitSetFramefromIndex - the index to start checking from (inclusive)-1 if there is no such bitBitSetFrame.clearNextSetBit(net.openhft.chronicle.algo.bytes.Access<T>, T, long, long)public BitSetFrame.Bits setBits()
BitSetFramesetBits in interface BitSetFramepublic BitSetAlgorithm algorithm()
algorithm in interface BitSetFramepublic <T> long clearNextSetBit(Access<T> access, T handle, long offset, long fromIndex)
BitSetFrametrue
that occurs on or after the specified starting index. If no such
bit exists then -1 is returned.clearNextSetBit in interface BitSetFramefromIndex - the index to start checking from (inclusive)-1 if there is no such bitBitSetFrame.nextSetBit(net.openhft.chronicle.algo.bytes.Access<T>, T, long, long)public <T> long nextClearBit(Access<T> access, T handle, long offset, long fromIndex)
BitSetFramefalse
that occurs on or after the specified starting index. If no such
bit exists then -1 is returned.nextClearBit in interface BitSetFramefromIndex - the index to start checking from (inclusive)-1 if there is no such bitBitSetFrame.setNextClearBit(net.openhft.chronicle.algo.bytes.Access<T>, T, long, long)public <T> long setNextClearBit(Access<T> access, T handle, long offset, long fromIndex)
BitSetFrametrue the first bit that is set to false
that occurs on or after the specified starting index. If no such
bit exists then -1 is returned.setNextClearBit in interface BitSetFramefromIndex - the index to start checking from (inclusive)-1 if there is no such bitBitSetFrame.nextClearBit(net.openhft.chronicle.algo.bytes.Access<T>, T, long, long)public <T> long previousSetBit(Access<T> access, T handle, long offset, long fromIndex)
BitSetFrametrue
that occurs on or before the specified starting index.
If no such bit exists, or if -1 is given as the
starting index, then -1 is returned.previousSetBit in interface BitSetFramefromIndex - the index to start checking from (inclusive)-1 if there is no such bitBitSetFrame.clearPreviousSetBit(net.openhft.chronicle.algo.bytes.Access<T>, T, long, long)public <T> long clearPreviousSetBit(Access<T> access, T handle, long offset, long fromIndex)
BitSetFrametrue
that occurs on or before the specified starting index.
If no such bit exists, or if -1 is given as the
starting index, then -1 is returned.clearPreviousSetBit in interface BitSetFramefromIndex - the index to start checking from (inclusive)-1 if there is no such bitBitSetFrame.previousSetBit(net.openhft.chronicle.algo.bytes.Access<T>, T, long, long)public <T> long previousClearBit(Access<T> access, T handle, long offset, long fromIndex)
BitSetFramefalse
that occurs on or before the specified starting index.
If no such bit exists, or if -1 is given as the
starting index, then -1 is returned.previousClearBit in interface BitSetFramefromIndex - the index to start checking from (inclusive)-1 if there is no such bitBitSetFrame.setPreviousClearBit(net.openhft.chronicle.algo.bytes.Access<T>, T, long, long)public <T> long setPreviousClearBit(Access<T> access, T handle, long offset, long fromIndex)
BitSetFrametrue the nearest bit that is set
to false that occurs on or before the specified starting index.
If no such bit exists, or if -1 is given as the
starting index, then -1 is returned.setPreviousClearBit in interface BitSetFramefromIndex - the index to start checking from (inclusive)-1 if there is no such bitBitSetFrame.previousClearBit(net.openhft.chronicle.algo.bytes.Access<T>, T, long, long)public long logicalSize()
BitSetFramelogicalSize() - 1.logicalSize in interface BitSetFramepublic long sizeInBytes()
BitSetFramesizeInBytes in interface BitSetFramepublic <T> long cardinality(Access<T> access, T handle, long offset)
BitSetFrametrue in the bit set.cardinality in interface BitSetFramepublic <T> long setNextNContinuousClearBits(Access<T> access, T handle, long offset, long fromIndex, int numberOfBits)
DirectBitSet interface. For the sake of atomicity this
implementation couldn't find and flip the range crossing native word
boundary, e. g. bits from 55 to 75 (boundary is 64).setNextNContinuousClearBits in interface BitSetFramefromIndex - the index to start checking from (inclusive)numberOfBits - how many continuous clear bits to search and set-1 if there is no such rangeIllegalArgumentException - if numberOfBits
is out of range 0 < numberOfBits && numberOfBits <= 64public <T> long clearNextNContinuousSetBits(Access<T> access, T handle, long offset, long fromIndex, int numberOfBits)
BitSetFrame interface. For the sake of atomicity this
implementation couldn't find and flip the range crossing native word
boundary, e. g. bits from 55 to 75 (boundary is 64).clearNextNContinuousSetBits in interface BitSetFramefromIndex - the index to start checking from (inclusive)numberOfBits - how many continuous set bits to search and cleartrue bits, or -1 if there is no such rangeIllegalArgumentException - if numberOfBits
is out of range 0 < numberOfBits && numberOfBits <= 64public <T> long setPreviousNContinuousClearBits(Access<T> access, T handle, long offset, long fromIndex, int numberOfBits)
DirectBitSet interface. For the sake of atomicity this
implementation couldn't find and flip the range crossing native word
boundary, e. g. bits from 55 to 75 (boundary is 64).setPreviousNContinuousClearBits in interface BitSetFramefromIndex - the index to start checking from (inclusive)numberOfBits - how many continuous clear bits to search and set-1 if there is no such rangeIllegalArgumentException - if numberOfBits
is out of range 0 < numberOfBits && numberOfBits <= 64public <T> long clearPreviousNContinuousSetBits(Access<T> access, T handle, long offset, long fromIndex, int numberOfBits)
DirectBitSet interface. For the sake of atomicity this
implementation couldn't find and flip the range crossing native word
boundary, e. g. bits from 55 to 75 (boundary is 64).clearPreviousNContinuousSetBits in interface BitSetFramefromIndex - the index to start checking from (inclusive)numberOfBits - how many continuous set bits to search and cleartrue bits, or -1 if there is no such rangeIllegalArgumentException - if numberOfBits
is out of range 0 < numberOfBits && numberOfBits <= 64Copyright © 2018. All rights reserved.