Class TrieMap<K,​V>

  • Type Parameters:
    K - List of K ist a key in this map.
    V - Values stored.

    public class TrieMap<K,​V>
    extends Object
    A TrieMap is a Map with sequences as keys that are organized in a Trie for value retrieval.
    • Constructor Detail

      • TrieMap

        public TrieMap()
    • Method Detail

      • create

        public static <K,​V> TrieMap<K,​V> create()
        Returns a fresh empty trie.
      • isEmpty

        public boolean isEmpty()
      • put

        public void put​(List<K> ks,
                        V val)
        Put value at provided key position. Will replace existing.
      • has

        public boolean has​(List<K> ks,
                           boolean inSubtree)
        Check whether the value at the precise given key (for inSubtree=false) or its subtree (for inSubtree=true) exists.
      • get

        public Optional<V> get​(List<K> ks,
                               boolean any)
        Retrieve value at given key. If any=true, returns any value in subtree rooted at key.
      • getRootValue

        public Optional<V> getRootValue()
      • size

        public int size()
        Returns size (O(n) operation, traverses tree).