KeyAnalyzer for Strings.
| Modifier and Type | Field and Description |
|---|---|
| public static final StringKeyAnalyzer | INSTANCE
A singleton instance of |
| public static final int | |
| private static final int | MSB
A bit mask where the first bit is 1 and the others are zero. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | bitIndex(final String
the key to use key, final int the bit offset in the key offsetInBits, final int the maximum key length in bits to use lengthInBits, final String the other key to use other, final int the bit offset in the other key otherOffsetInBits, final int the maximum key length in bits for the other key otherLengthInBits)Implements abstract org. |
| public int | bitsPerElement()
Implements abstract org. |
| public boolean | isBitSet(final String
the key to check, may not be null key, final int the bit index to check bitIndex, final int the maximum key length in bits to check lengthInBits)Implements abstract org. |
| public boolean | isPrefix(final String
the prefix to check prefix, final int the bit offset in the key offsetInBits, final int the maximum key length in bits to use lengthInBits, final String the key to check key)Implements abstract org. |
| public int | lengthInBits(final String
the key key)Implements abstract org. |
| private static int |
| INSTANCE | back to summary |
|---|---|
| public static final StringKeyAnalyzer INSTANCE A singleton instance of | |
| LENGTH | back to summary |
|---|---|
| public static final int LENGTH The number of bits per | |
| MSB | back to summary |
|---|---|
| private static final int MSB A bit mask where the first bit is 1 and the others are zero. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. | |
| StringKeyAnalyzer | back to summary |
|---|---|
| public StringKeyAnalyzer() | |
| bitIndex | back to summary |
|---|---|
| public int bitIndex(final String key, final int offsetInBits, final int lengthInBits, final String other, final int otherOffsetInBits, final int otherLengthInBits) Implements abstract org. Doc from org. Returns the n-th different bit between key and other. This starts the comparison in key at 'offsetInBits' and goes for 'lengthInBits' bits, and compares to the other key starting at 'otherOffsetInBits' and going for 'otherLengthInBits' bits.
| |
| bitsPerElement | back to summary |
|---|---|
| public int bitsPerElement() Implements abstract org. Doc from org. Returns the number of bits per element in the key. This is only useful for variable-length keys, such as Strings.
| |
| isBitSet | back to summary |
|---|---|
| public boolean isBitSet(final String key, final int bitIndex, final int lengthInBits) Implements abstract org. Doc from org. Returns whether or not a bit is set. | |
| isPrefix | back to summary |
|---|---|
| public boolean isPrefix(final String prefix, final int offsetInBits, final int lengthInBits, final String key) Implements abstract org. Doc from org. Determines whether or not the given prefix (from offset to length) is a prefix of the given key. | |
| lengthInBits | back to summary |
|---|---|
| public int lengthInBits(final String key) Implements abstract org. Doc from org. Returns the length of the Key in bits. | |
| mask | back to summary |
|---|---|
| private static int mask(final int bit) Returns a bit mask where the given bit is set. | |