Class Trie.Node<K extends Comparable<? super K>,V>

java.lang.Object
eu.bandm.tools.util.Trie.Node<K,V>
Enclosing class:
Trie<K extends Comparable<? super K>,V>

public static class Trie.Node<K extends Comparable<? super K>,V> extends Object
Immutable data, each instance represents one cell (inner node or leaf) of the whole Trie.
  • Constructor Details

  • Method Details

    • unit

      public static <K extends Comparable<? super K>, V> Trie.Node<K,V> unit(V value)
      Create a cell labelled with the value and having no subnodes.
    • singleton

      public static <K extends Comparable<? super K>, V> Trie.Node<K,V> singleton(V pre, K key, V post)
      Create a cell labelled with the value and having one subnode with given key and post value.
    • sequence

      public static <K extends Comparable<? super K>, V> Trie.Node<K,V> sequence(V pre, Iterable<? extends K> keys, V post)
    • sequence

      protected static <K extends Comparable<? super K>, V> Trie.Node<K,V> sequence(V pre, Iterator<? extends K> keys, V post)
    • getValue

      public final V getValue()
    • branches

      public final SortedMap<K,Trie.Node<K,V>> branches()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • equals

      public boolean equals(Trie.Node<?,?> o)