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 void
clear()
boolean
containsKey(Object key)
boolean
containsKeyWithPrefix(List<?> prefix)
boolean
containsValue(Object value)
Set<Map.Entry<List<K>,V>>
entrySet()
V
get(Object key)
boolean
isEmpty()
V
put(List<K> key, V value)
V
remove(Object key)
int
size()
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:
containsKeyWithPrefix
in interfaceTrieMap<K,V>
-
subTrie
public HashTrieMap<K,V> subTrie(List<? extends K> prefix)
Description copied from interface:TrieMap
Retrieves 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:
containsKey
in interfaceMap<K,V>
- Overrides:
containsKey
in classAbstractMap<List<K>,V>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<K,V>
- Overrides:
containsValue
in classAbstractMap<List<K>,V>
-
clear
public void clear()
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
-