public 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, valuesfinalize, getClass, notify, notifyAll, wait, wait, waitcomparator, entrySet, firstKey, headMap, keySet, lastKey, subMap, tailMap, valuesfirstKey, lastKey, mapIterator, nextKey, previousKeyclear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, sizecontainsKey, containsValue, entrySet, get, isEmpty, keySet, remove, size, valuesprivate 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 Triefinal 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)