public static class BitKey.Small extends BitKey.AbstractBitKey
BitKey for bit counts less than 64.BitKey.AbstractBitKey, BitKey.Big, BitKey.Factory, BitKey.Mid128, BitKey.SmallChunkBitCount, Mask, WORD_MASKbitPositionTable, EMPTY| Modifier and Type | Method and Description |
|---|---|
BitKey |
and(BitKey bitKey)
Returns the boolean AND of this bitkey and the given bitkey.
|
BitKey |
andNot(BitKey bitKey)
Returns a
BitKey containing all of the bits in this
BitSet whose corresponding
bit is NOT set in the specified BitSet. |
int |
cardinality()
Returns the number of bits set.
|
void |
clear()
Sets all of the bits in this BitKey to
false. |
void |
clear(int pos)
Sets the bit specified by the index to
false. |
int |
compareTo(BitKey bitKey) |
protected int |
compareToBig(BitKey.Big that) |
BitKey |
copy()
Returns a copy of this BitKey.
|
BitKey |
emptyCopy()
Returns an empty BitKey of the same type.
|
boolean |
equals(Object o) |
boolean |
get(int pos)
Returns the value of the bit with the specified index.
|
int |
hashCode() |
boolean |
intersects(BitKey bitKey)
Returns whether this BitKey has any bits in common with a given BitKey.
|
boolean |
isEmpty()
Returns true if this
BitKey contains no bits that are set
to true. |
boolean |
isSuperSetOf(BitKey bitKey)
Is every bit set in the parameter
bitKey also set in
this. |
Iterator<Integer> |
iterator()
To say that I am happy about this algorithm (or the variations
of the algorithm used for the Mid128 and Big BitKey implementations)
would be a stretch.
|
int |
nextSetBit(int fromIndex)
Returns the index of the first bit that is set to
true
that occurs on or after the specified starting index. |
BitKey |
or(BitKey bitKey)
Or the parameter
BitKey with this. |
BitKey |
orNot(BitKey bitKey)
XOr the parameter
BitKey with this. |
void |
set(int pos)
Sets the bit at the specified index to
true. |
BitSet |
toBitSet()
Returns a
BitSet with the same contents as this BitKey. |
String |
toString() |
bit, bitCount, chunkCount, chunkPos, copyFromByte, copyFromLong, createException, setclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic void set(int pos)
BitKeytrue.public boolean get(int pos)
BitKeytrue if the bit with the index bitIndex
is currently set in this BitKey; otherwise, the result
is false.public void clear(int pos)
BitKeyfalse.public void clear()
BitKeyfalse.public int cardinality()
BitKeypublic BitKey or(BitKey bitKey)
BitKeyBitKey with this.bitKey - Bit keypublic BitKey orNot(BitKey bitKey)
BitKeyBitKey with this.bitKey - Bit keypublic BitKey and(BitKey bitKey)
BitKeybitKey - Bit keypublic BitKey andNot(BitKey bitKey)
BitKeyBitKey containing all of the bits in this
BitSet whose corresponding
bit is NOT set in the specified BitSet.public boolean isSuperSetOf(BitKey bitKey)
BitKeybitKey also set in
this.
If one switches this with the parameter bitKey
one gets the equivalent of isSubSetOf.bitKey - Bit keypublic boolean intersects(BitKey bitKey)
BitKeypublic BitSet toBitSet()
BitKeyBitSet with the same contents as this BitKey.public Iterator<Integer> iterator()
public int nextSetBit(int fromIndex)
BitKeytrue
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 BitKey,
use the following loop:
for (int i = bk.nextSetBit(0); i >= 0; i = bk.nextSetBit(i + 1)) {
// operate on index i here
}fromIndex - the index to start checking from (inclusive)public int compareTo(BitKey bitKey)
protected int compareToBig(BitKey.Big that)
public BitKey copy()
BitKeypublic BitKey emptyCopy()
BitKeyBitKey.copy() followed by BitKey.clear().public boolean isEmpty()
BitKeyBitKey contains no bits that are set
to true.Copyright © 2021 Hitachi Vantara. All rights reserved.