public class StringKeyAnalyzer extends KeyAnalyzer<java.lang.String>
KeyAnalyzer
for String
s.Modifier and Type | Field | 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 | Description |
---|---|
StringKeyAnalyzer() |
Modifier and Type | Method | Description |
---|---|---|
int |
bitIndex(java.lang.String key,
int offsetInBits,
int lengthInBits,
java.lang.String other,
int otherOffsetInBits,
int otherLengthInBits) |
Returns the n-th different bit between key and other.
|
int |
bitsPerElement() |
Returns the number of bits per element in the key.
|
boolean |
isBitSet(java.lang.String key,
int bitIndex,
int lengthInBits) |
Returns whether or not a bit is set.
|
boolean |
isPrefix(java.lang.String prefix,
int offsetInBits,
int lengthInBits,
java.lang.String key) |
Determines whether or not the given prefix (from offset to length) is a prefix of the given key.
|
int |
lengthInBits(java.lang.String key) |
Returns the length of the Key in bits.
|
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
compare
public static final StringKeyAnalyzer INSTANCE
StringKeyAnalyzer
.public static final int LENGTH
Character
.public int bitsPerElement()
KeyAnalyzer
bitsPerElement
in class KeyAnalyzer<java.lang.String>
public int lengthInBits(java.lang.String key)
KeyAnalyzer
lengthInBits
in class KeyAnalyzer<java.lang.String>
key
- the keypublic int bitIndex(java.lang.String key, int offsetInBits, int lengthInBits, java.lang.String other, int otherOffsetInBits, int otherLengthInBits)
KeyAnalyzer
bitIndex
in class KeyAnalyzer<java.lang.String>
key
- the key to useoffsetInBits
- the bit offset in the keylengthInBits
- the maximum key length in bits to useother
- the other key to useotherOffsetInBits
- the bit offset in the other keyotherLengthInBits
- the maximum key length in bits for the other keypublic boolean isBitSet(java.lang.String key, int bitIndex, int lengthInBits)
KeyAnalyzer
isBitSet
in class KeyAnalyzer<java.lang.String>
key
- the key to check, may not be nullbitIndex
- the bit index to checklengthInBits
- the maximum key length in bits to checktrue
if the bit is set in the given key and
bitIndex
< lengthInBits
, false
otherwise.public boolean isPrefix(java.lang.String prefix, int offsetInBits, int lengthInBits, java.lang.String key)
KeyAnalyzer
isPrefix
in class KeyAnalyzer<java.lang.String>
prefix
- the prefix to checkoffsetInBits
- the bit offset in the keylengthInBits
- the maximum key length in bits to usekey
- the key to checktrue
if this is a valid prefix for the given keyCopyright © 2001-2019 - Apache Software Foundation