Package eu.bandm.tools.ops
Class Trie.Evaluator<K extends Comparable<? super K>,V>
java.lang.Object
eu.bandm.tools.ops.Trie.Evaluator<K,V>
- Enclosing class:
- Trie<K extends Comparable<? super K>,
V>
Realizes alebraic operation on Tries.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionFundamental retrieval operation: Get the list ofMap.Entry
containing prefix (from K*) and values.protected <W> W
<W> W
Special kind of folding as follows:
For all leaf nodes fun is applied to their value and to an empty map.foldNode
(BiFunction<? super V, ? super SortedMap<K, Trie.Node<K, W>>, ? extends Trie.Node<K, W>> fun, Trie<K, V> x) protected boolean
boolean
Fundamental retrieval operation: Get the subtree starting at the given key prefix.Fundamental retrieval operation: Get the value entry at the given key prefix.Prunes tree at the given maximal depth and inserts the "horizon" element, as defined in the constructor callEvaluator(Monoid,Object,int)
.Unify Trie data using Monoid function on values.
-
Field Details
-
values
-
horizon
-
limit
final int limit -
unit
-
-
Constructor Details
-
Evaluator
public Evaluator()CallsEvaluator(Monoid,Object,int)
with no limit, no horizon and the discrete monoid, which treats null as neutral element (read "no value entered here"). -
Evaluator
- Parameters:
limit
- the maximal depth for pruning trieshorizon
- the element which replaces pruned subtreesvalues
- the Monoid required for combining values when unifying branches
-
-
Method Details
-
union
Unify Trie data using Monoid function on values. -
union
-
union
-
compose
-
compose
-
compose
-
compose
-
trim
Prunes tree at the given maximal depth and inserts the "horizon" element, as defined in the constructor callEvaluator(Monoid,Object,int)
. -
leq
-
leq
-
iterate
-
select
Fundamental retrieval operation: Get the value entry at the given key prefix. -
restrict
Fundamental retrieval operation: Get the subtree starting at the given key prefix. -
restrict
-
entries
-
entries
Fundamental retrieval operation: Get the list ofMap.Entry
containing prefix (from K*) and values. -
fold
Special kind of folding as follows:
For all leaf nodes fun is applied to their value and to an empty map. This yields a value from W.
For each inner node the result from W is calculated by applying fun to its value (form V) and to a map K->W which collects the folding results of its childs sequence. -
fold
-
foldValue
-
foldNode
-