public class StringKeyAnalyzer extends KeyAnalyzer<String >
KeyAnalyzer for
Strings.
| Modifier and Type | Field and Description |
|---|---|
static StringKeyAnalyzer |
INSTANCE
A singleton instance of
StringKeyAnalyzer.
|
static int |
LENGTH
The number of bits per
Character.
|
EQUAL_BIT_KEY, NULL_BIT_KEY, OUT_OF_BOUNDS_BIT_KEY| Constructor and Description |
|---|
StringKeyAnalyzer()
|
| Modifier and Type | Method and Description |
|---|---|
int |
bitIndex(String
Returns the n-th different bit between key and other.
|
int |
bitsPerElement()
Returns the number of bits per element in the key.
|
boolean |
isBitSet(String
Returns whether or not a bit is set.
|
boolean |
isPrefix(String
Determines whether or not the given prefix (from offset to length) is a prefix of the given key.
|
int |
lengthInBits(String
Returns the length of the Key in bits.
|
compareclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic static final StringKeyAnalyzerINSTANCE
StringKeyAnalyzer.
public static final int LENGTH
Character.
public int bitsPerElement()
KeyAnalyzer
bitsPerElement in class
KeyAnalyzer<String>
public int lengthInBits(Stringkey)
KeyAnalyzer
lengthInBits in class
KeyAnalyzer<String>
key - the key
public int bitIndex(Stringkey, int offsetInBits, int lengthInBits, String other, int otherOffsetInBits, int otherLengthInBits)
KeyAnalyzer
bitIndex in class
KeyAnalyzer<String>
key - the key to use
offsetInBits - the bit offset in the key
lengthInBits - the maximum key length in bits to use
other - the other key to use
otherOffsetInBits - the bit offset in the other key
otherLengthInBits - the maximum key length in bits for the other key
public boolean isBitSet(Stringkey, int bitIndex, int lengthInBits)
KeyAnalyzer
isBitSet in class
KeyAnalyzer<String>
key - the key to check, may not be null
bitIndex - the bit index to check
lengthInBits - the maximum key length in bits to check
true if the bit is set in the given key and
bitIndex <
lengthInBits,
false otherwise.
public boolean isPrefix(Stringprefix, int offsetInBits, int lengthInBits, String key)
KeyAnalyzer
isPrefix in class
KeyAnalyzer<String>
prefix - the prefix to check
offsetInBits - the bit offset in the key
lengthInBits - the maximum key length in bits to use
key - the key to check
true if this is a valid prefix for the given key