Package owl.collections
Class HashTrieMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<List<K>,V>
-
- owl.collections.HashTrieMap<K,V>
-
- Type Parameters:
K- List of K ist a key in this map.V- Values stored.
public class HashTrieMap<K,V> extends AbstractMap<List<K>,V> implements TrieMap<K,V>
A TrieMap is a Map with sequences as keys that are organized in a Trie for value retrieval.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description HashTrieMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(Object key)booleancontainsKeyWithPrefix(List<?> prefix)booleancontainsValue(Object value)Set<Map.Entry<List<K>,V>>entrySet()Vget(Object key)booleanisEmpty()Vput(List<K> key, V value)Vremove(Object key)intsize()HashTrieMap<K,V>subTrie(List<? extends K> prefix)Retrieves the trieMap associated with the given prefix.Map<K,? extends TrieMap<K,V>>subTries()-
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, keySet, putAll, toString, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, values
-
-
-
-
Method Detail
-
containsKeyWithPrefix
public boolean containsKeyWithPrefix(List<?> prefix)
- Specified by:
containsKeyWithPrefixin interfaceTrieMap<K,V>
-
subTrie
public HashTrieMap<K,V> subTrie(List<? extends K> prefix)
Description copied from interface:TrieMapRetrieves the trieMap associated with the given prefix. Any changes to the subtrie are reflected in the trieMap and vice-versa.
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<K,V>- Overrides:
containsKeyin classAbstractMap<List<K>,V>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<K,V>- Overrides:
containsValuein classAbstractMap<List<K>,V>
-
clear
public void clear()
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
-