Class AbstractBitwiseTrie<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
org.apache.commons.collections4.trie.AbstractBitwiseTrie<K,V>
- Type Parameters:
K- the type of the keys in this mapV- the type of the values in this map
- All Implemented Interfaces:
Serializable,Map<K,,V> SortedMap<K,,V> Get<K,,V> IterableGet<K,,V> IterableMap<K,,V> IterableSortedMap<K,,V> OrderedMap<K,,V> Put<K,,V> Trie<K,V>
- Direct Known Subclasses:
AbstractPatriciaTrie
public abstract class AbstractBitwiseTrie<K,V>
extends AbstractMap<K,V>
implements Trie<K,V>, Serializable
This class provides some basic
Trie functionality and
utility methods for actual bitwise Trie implementations.- Since:
- 4.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classA basic implementation ofMap.Entry.Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final KeyAnalyzer<? super K> TheKeyAnalyzerthat's being used to build the PATRICIATrie.private static final long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractBitwiseTrie(KeyAnalyzer<? super K> keyAnalyzer) Constructs a newTrieusing the givenKeyAnalyzer. -
Method Summary
Modifier and TypeMethodDescription(package private) final intUtility method for callingKeyAnalyzer.bitIndex(Object, int, int, Object, int, int).(package private) final intReturns the number of bits per element in the key(package private) final KA utility method to cast keys.(package private) static booleanDelegates toObjects.equals(Object, Object).(package private) final booleancompareKeys(K key, K other) A utility method for callingKeyAnalyzer.compare(Object, Object)protected KeyAnalyzer<? super K> Gets theKeyAnalyzerthat constructed theTrie.(package private) final booleanReturns whether or not the given bit on the key is set or false if the key is null.(package private) final intlengthInBits(K key) Returns the length of the given key in bitstoString()Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.commons.collections4.Get
containsKey, containsValue, entrySet, get, isEmpty, keySet, remove, size, valuesMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, sizeMethods inherited from interface org.apache.commons.collections4.OrderedMap
firstKey, lastKey, mapIterator, nextKey, previousKey
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
keyAnalyzer
TheKeyAnalyzerthat's being used to build the PATRICIATrie.
-
-
Constructor Details
-
AbstractBitwiseTrie
Constructs a newTrieusing the givenKeyAnalyzer.- Parameters:
keyAnalyzer- theKeyAnalyzerto use
-
-
Method Details
-
compare
Delegates toObjects.equals(Object, Object). -
bitIndex
Utility method for callingKeyAnalyzer.bitIndex(Object, int, int, Object, int, int). -
bitsPerElement
final int bitsPerElement()Returns the number of bits per element in the key- See Also:
-
castKey
A utility method to cast keys. It actually doesn't cast anything. It's just fooling the compiler! -
compareKeys
A utility method for callingKeyAnalyzer.compare(Object, Object) -
getKeyAnalyzer
Gets theKeyAnalyzerthat constructed theTrie.- Returns:
- the
KeyAnalyzerused by thisTrie
-
isBitSet
Returns whether or not the given bit on the key is set or false if the key is null.- See Also:
-
lengthInBits
Returns the length of the given key in bits- See Also:
-
toString
- Overrides:
toStringin classAbstractMap<K,V>
-