K
- the type of the keys in this mapV
- the type of the values in this mappublic abstract class AbstractBitwiseTrie<K,V> extends java.util.AbstractMap<K,V> implements Trie<K,V>, java.io.Serializable
Trie
functionality and
utility methods for actual bitwise Trie
implementations.Modifier and Type | Class and Description |
---|---|
(package private) static class |
AbstractBitwiseTrie.BasicEntry<K,V>
A basic implementation of
Map.Entry . |
Modifier and Type | Field and Description |
---|---|
private KeyAnalyzer<? super K> |
keyAnalyzer
The
KeyAnalyzer that's being used to build the PATRICIA Trie . |
private static long |
serialVersionUID |
Modifier | Constructor and Description |
---|---|
protected |
AbstractBitwiseTrie(KeyAnalyzer<? super K> keyAnalyzer)
Constructs a new
Trie using the given KeyAnalyzer . |
Modifier and Type | Method and Description |
---|---|
(package private) int |
bitIndex(K key,
K foundKey)
Utility method for calling
KeyAnalyzer.bitIndex(Object, int, int, Object, int, int) . |
(package private) int |
bitsPerElement()
Returns the number of bits per element in the key
|
(package private) K |
castKey(java.lang.Object key)
A utility method to cast keys.
|
(package private) static boolean |
compare(java.lang.Object a,
java.lang.Object b)
Returns true if both values are either null or equal.
|
(package private) boolean |
compareKeys(K key,
K other)
An utility method for calling
KeyAnalyzer.compare(Object, Object) |
protected KeyAnalyzer<? super K> |
getKeyAnalyzer()
Returns the
KeyAnalyzer that constructed the Trie . |
(package private) boolean |
isBitSet(K key,
int bitIndex,
int lengthInBits)
Returns whether or not the given bit on the key is set or false if the key is null.
|
(package private) int |
lengthInBits(K key)
Returns the length of the given key in bits
|
java.lang.String |
toString() |
clear, clone, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
finalize, getClass, notify, notifyAll, wait, wait, wait
comparator, entrySet, firstKey, headMap, keySet, lastKey, subMap, tailMap, values
firstKey, lastKey, mapIterator, nextKey, previousKey
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
containsKey, containsValue, entrySet, get, isEmpty, keySet, remove, size, values
private static final long serialVersionUID
private final KeyAnalyzer<? super K> keyAnalyzer
KeyAnalyzer
that's being used to build the PATRICIA Trie
.protected AbstractBitwiseTrie(KeyAnalyzer<? super K> keyAnalyzer)
Trie
using the given KeyAnalyzer
.keyAnalyzer
- the KeyAnalyzer
to useprotected KeyAnalyzer<? super K> getKeyAnalyzer()
KeyAnalyzer
that constructed the Trie
.KeyAnalyzer
used by this Trie
final K castKey(java.lang.Object key)
final int lengthInBits(K key)
KeyAnalyzer.lengthInBits(Object)
final int bitsPerElement()
KeyAnalyzer.bitsPerElement()
final boolean isBitSet(K key, int bitIndex, int lengthInBits)
KeyAnalyzer.isBitSet(Object, int, int)
final int bitIndex(K key, K foundKey)
KeyAnalyzer.bitIndex(Object, int, int, Object, int, int)
.final boolean compareKeys(K key, K other)
KeyAnalyzer.compare(Object, Object)
static boolean compare(java.lang.Object a, java.lang.Object b)