public abstract static class BitKey.AbstractBitKey extends Object implements BitKey
BitKey
.BitKey.AbstractBitKey, BitKey.Big, BitKey.Factory, BitKey.Mid128, BitKey.Small
Modifier and Type | Field and Description |
---|---|
protected static int |
ChunkBitCount |
protected static int |
Mask |
protected static long |
WORD_MASK |
bitPositionTable, EMPTY
Constructor and Description |
---|
AbstractBitKey() |
Modifier and Type | Method and Description |
---|---|
protected static long |
bit(int pos)
Creates a chunk containing a single bit.
|
protected static int |
bitCount(long i)
Returns the number of one-bits in the two's complement binary
representation of the specified long value.
|
protected static int |
chunkCount(int size)
Returns the number of chunks required for a given number of bits.
|
protected static int |
chunkPos(int size)
Returns which chunk a given bit falls into.
|
protected static void |
copyFromByte(BitSet bitSet,
int pos,
byte x)
Copies a byte into a bit set at a particular position.
|
protected static void |
copyFromLong(BitSet bitSet,
int pos,
long x)
Copies a
long value (interpreted as 64 bits) into a bit set. |
protected IllegalArgumentException |
createException(BitKey bitKey) |
void |
set(int pos,
boolean value)
Sets the bit at the specified index to the specified value.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
and, andNot, cardinality, clear, clear, copy, emptyCopy, get, intersects, isEmpty, isSuperSetOf, iterator, nextSetBit, or, orNot, set, toBitSet
compareTo
forEach, spliterator
protected static final int ChunkBitCount
protected static final int Mask
protected static final long WORD_MASK
protected static long bit(int pos)
protected static int chunkPos(int size)
protected static int chunkCount(int size)
0 bits requires 0 chunks; 1 - 64 bits requires 1 chunk; etc.
protected static int bitCount(long i)
(Copied from Long.bitCount(long)
, which was
introduced in JDK 1.5, but we need the functionality in JDK 1.4.)
public final void set(int pos, boolean value)
BitKey
protected static void copyFromByte(BitSet bitSet, int pos, byte x)
bitSet
- Bit setpos
- Positionx
- Byteprotected static void copyFromLong(BitSet bitSet, int pos, long x)
long
value (interpreted as 64 bits) into a bit set.bitSet
- Bit setpos
- Positionx
- Byteprotected IllegalArgumentException createException(BitKey bitKey)
Copyright © 2020 Hitachi Vantara. All rights reserved.