Package mondrian.rolap
Class BitKey.AbstractBitKey
java.lang.Object
mondrian.rolap.BitKey.AbstractBitKey
- All Implemented Interfaces:
Serializable,Comparable<BitKey>,Iterable<Integer>,BitKey
- Direct Known Subclasses:
BitKey.Big,BitKey.Mid128,BitKey.Small
- Enclosing interface:
- BitKey
Abstract implementation of
BitKey.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface mondrian.rolap.BitKey
BitKey.AbstractBitKey, BitKey.Big, BitKey.Factory, BitKey.Mid128, BitKey.Small -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final longFields inherited from interface mondrian.rolap.BitKey
bitPositionTable, EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static longbit(int pos) Creates a chunk containing a single bit.protected static intbitCount(long i) Returns the number of one-bits in the two's complement binary representation of the specified long value.protected static intchunkCount(int size) Returns the number of chunks required for a given number of bits.protected static intchunkPos(int size) Returns which chunk a given bit falls into.protected static voidcopyFromByte(BitSet bitSet, int pos, byte x) Copies a byte into a bit set at a particular position.protected static voidcopyFromLong(BitSet bitSet, int pos, long x) Copies alongvalue (interpreted as 64 bits) into a bit set.protected IllegalArgumentExceptioncreateException(BitKey bitKey) final voidset(int pos, boolean value) Sets the bit at the specified index to the specified value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface mondrian.rolap.BitKey
and, andNot, cardinality, clear, clear, copy, emptyCopy, get, intersects, isEmpty, isSuperSetOf, iterator, nextSetBit, or, orNot, set, toBitSetMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
ChunkBitCount
protected static final int ChunkBitCount- See Also:
-
Mask
protected static final int Mask- See Also:
-
WORD_MASK
protected static final long WORD_MASK- See Also:
-
-
Constructor Details
-
AbstractBitKey
public AbstractBitKey()
-
-
Method Details
-
bit
protected static long bit(int pos) Creates a chunk containing a single bit. -
chunkPos
protected static int chunkPos(int size) Returns which chunk a given bit falls into. Bits 0 to 63 fall in chunk 0, bits 64 to 127 fall into chunk 1. -
chunkCount
protected static int chunkCount(int size) Returns the number of chunks required for a given number of bits.0 bits requires 0 chunks; 1 - 64 bits requires 1 chunk; etc.
-
bitCount
protected static int bitCount(long i) Returns the number of one-bits in the two's complement binary representation of the specified long value. This function is sometimes referred to as the population count.(Copied from
Long.bitCount(long), which was introduced in JDK 1.5, but we need the functionality in JDK 1.4.)- Returns:
- the number of one-bits in the two's complement binary representation of the specified long value.
- Since:
- 1.5
-
set
public final void set(int pos, boolean value) Description copied from interface:BitKeySets the bit at the specified index to the specified value. -
copyFromByte
Copies a byte into a bit set at a particular position.- Parameters:
bitSet- Bit setpos- Positionx- Byte
-
copyFromLong
Copies alongvalue (interpreted as 64 bits) into a bit set.- Parameters:
bitSet- Bit setpos- Positionx- Byte
-
createException
-