public class ByteArrayKeyAnalyzer extends AbstractKeyAnalyzer<byte[]>
KeyAnalyzer
for byte[]sModifier and Type | Field and Description |
---|---|
static ByteArrayKeyAnalyzer |
INSTANCE
A singleton instance of
ByteArrayKeyAnalyzer |
static int |
LENGTH
The length of an
Byte in bits |
EQUAL_BIT_KEY, NULL_BIT_KEY, OUT_OF_BOUNDS_BIT_KEY
Constructor and Description |
---|
ByteArrayKeyAnalyzer(int maxLengthInBits) |
Modifier and Type | Method and Description |
---|---|
int |
bitIndex(byte[] key,
int offsetInBits,
int lengthInBits,
byte[] other,
int otherOffsetInBits,
int otherLengthInBits)
Returns the n-th different bit between key and found.
|
int |
bitsPerElement()
Returns the number of bits per element in the key.
|
int |
compare(byte[] o1,
byte[] o2) |
int |
getMaxLengthInBits()
Returns the maximum length of a key in bits
|
boolean |
isBitSet(byte[] key,
int bitIndex,
int lengthInBits)
Returns whether or not a bit is set
|
boolean |
isPrefix(byte[] prefix,
int offsetInBits,
int lengthInBits,
byte[] key)
Determines whether or not the given prefix (from offset to length)
is a prefix of the given key.
|
int |
lengthInBits(byte[] key)
Returns the length of the Key in bits.
|
public static final ByteArrayKeyAnalyzer INSTANCE
ByteArrayKeyAnalyzer
public static final int LENGTH
Byte
in bitspublic int getMaxLengthInBits()
public int bitsPerElement()
public int lengthInBits(byte[] key)
public boolean isBitSet(byte[] key, int bitIndex, int lengthInBits)
public int bitIndex(byte[] key, int offsetInBits, int lengthInBits, byte[] other, int otherOffsetInBits, int otherLengthInBits)
public boolean isPrefix(byte[] prefix, int offsetInBits, int lengthInBits, byte[] key)
public int compare(byte[] o1, byte[] o2)
compare
in interface java.util.Comparator<byte[]>
compare
in class AbstractKeyAnalyzer<byte[]>
Copyright © 2005-2009 Roger Kapsi, Sam Berlin. All Rights Reserved.