public static class Trie.Evaluator<K extends Comparable<? super K>,V> extends Object
Constructor and Description |
---|
Evaluator()
Calls
Evaluator(Monoid,V,int) with no limit, no horizon and the
discrete monoid, which treats null as neutral element (read "no value entered here"). |
Evaluator(Monoid<V> values,
V horizon,
int limit) |
Modifier and Type | Method and Description |
---|---|
protected SortedMap<K,Trie.Node<K,V>> |
compose(SortedMap<K,Trie.Node<K,V>> x,
Function<V,Trie.Node<K,V>> f,
int limit) |
protected Trie.Node<K,V> |
compose(Trie.Node<K,V> x,
Function<V,Trie.Node<K,V>> f,
int limit) |
Trie<K,V> |
compose(Trie<K,V> x,
Function<V,Trie<K,V>> f) |
Trie<K,V> |
compose(Trie<K,V> x,
Function<V,Trie<K,V>> f,
int limit) |
protected Iterator<Map.Entry<List<? extends K>,V>> |
entries(Trie.Node<K,V> x,
List<? extends K> path) |
Iterable<Map.Entry<List<? extends K>,V>> |
entries(Trie<K,V> x)
Fundamental retrieval operation: Get the list of
Map.Entry containing
prefix (from K*) and values. |
protected <W> W |
fold(BiFunction<? super V,? super SortedMap<K,W>,? extends W> fun,
Trie.Node<K,V> x) |
<W> W |
fold(BiFunction<? super V,? super SortedMap<K,W>,? extends W> fun,
Trie<K,V> x)
Special kind of folding as follows:
For all leave nodes fun is applied to their value and to an empty map. |
protected <W> Trie<K,W> |
foldNode(BiFunction<? super V,? super SortedMap<K,Trie.Node<K,W>>,? extends Trie.Node<K,W>> fun,
Trie<K,V> x) |
protected <W> Trie<K,W> |
foldValue(BiFunction<? super V,? super SortedMap<K,W>,? extends W> fun,
Trie<K,V> x) |
Trie<K,V> |
iterate(Function<V,Trie<K,V>> f,
V init) |
protected boolean |
leq(Relation<? super V,? super V> valueLeq,
Trie.Node<K,V> x,
Trie.Node<K,V> y) |
boolean |
leq(Relation<? super V,? super V> valueLeq,
Trie<K,V> x,
Trie<K,V> y) |
protected Trie.Node<K,V> |
restrict(Trie.Node<K,V> x,
Iterator<? extends K> i) |
Trie<K,V> |
restrict(Trie<K,V> x,
Iterable<? extends K> path)
Fundamental retrieval operation: Get the subtree starting at the given key prefix.
|
V |
select(Trie<K,V> x,
Iterable<? extends K> path)
Fundamental retrieval operation: Get the value entry at the given key prefix.
|
protected Trie.Node<K,V> |
trim(Trie.Node<K,V> x,
int limit)
Prunes tree at the given maximal depth and inserts the "horizon" element, as
defined in the constructor call
Evaluator(Monoid,V,int) . |
protected SortedMap<K,Trie.Node<K,V>> |
union(SortedMap<K,Trie.Node<K,V>> x,
SortedMap<K,Trie.Node<K,V>> y) |
protected Trie.Node<K,V> |
union(Trie.Node<K,V> x,
Trie.Node<K,V> y) |
Trie<K,V> |
union(Trie<K,V> x,
Trie<K,V> y)
Unify Trie data using Monoid function on values.
|
protected final Trie.Node<K extends Comparable<? super K>,V> unit
public Evaluator()
Evaluator(Monoid,V,int)
with no limit, no horizon and the
discrete monoid, which treats null as neutral element (read "no value entered here").public Trie<K,V> union(Trie<K,V> x, Trie<K,V> y)
protected SortedMap<K,Trie.Node<K,V>> union(SortedMap<K,Trie.Node<K,V>> x, SortedMap<K,Trie.Node<K,V>> y)
protected SortedMap<K,Trie.Node<K,V>> compose(SortedMap<K,Trie.Node<K,V>> x, Function<V,Trie.Node<K,V>> f, int limit)
protected Trie.Node<K,V> trim(Trie.Node<K,V> x, int limit)
Evaluator(Monoid,V,int)
.protected boolean leq(Relation<? super V,? super V> valueLeq, Trie.Node<K,V> x, Trie.Node<K,V> y)
public V select(Trie<K,V> x, Iterable<? extends K> path)
public Trie<K,V> restrict(Trie<K,V> x, Iterable<? extends K> path)
protected Iterator<Map.Entry<List<? extends K>,V>> entries(Trie.Node<K,V> x, List<? extends K> path)
public Iterable<Map.Entry<List<? extends K>,V>> entries(Trie<K,V> x)
Map.Entry
containing
prefix (from K*) and values.public <W> W fold(BiFunction<? super V,? super SortedMap<K,W>,? extends W> fun, Trie<K,V> x)
protected <W> W fold(BiFunction<? super V,? super SortedMap<K,W>,? extends W> fun, Trie.Node<K,V> x)
protected <W> Trie<K,W> foldValue(BiFunction<? super V,? super SortedMap<K,W>,? extends W> fun, Trie<K,V> x)
see also the complete user documentation .