Module de.learnlib.datastructure
Class DiscriminationTreeIterators
java.lang.Object
de.learnlib.datastructure.discriminationtree.iterators.DiscriminationTreeIterators
Factory methods for several kinds of discrimination tree node iterators.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <N extends AbstractDTNode<?,?, ?, N>>
Iterator<N>innerNodeIterator(N root) Returns an iterator that traverses all inner nodes (no leaves) of a subtree of a given discrimination tree node.static <N extends AbstractDTNode<?,?, ?, N>>
Iterator<N>leafIterator(N root) Returns an iterator that traverses all leaves (no inner nodes) of a subtree of a given discrimination tree node.static <N extends AbstractDTNode<?,?, ?, N>>
Iterator<N>nodeIterator(N root) Returns an iterator that traverses all nodes of a subtree of a given discrimination tree node.static <N extends AbstractDTNode<?,?, ?, N>, D>
Iterator<D>transformingLeafIterator(N root, Function<? super N, D> transformer) Returns an iterator that traverses all leaves (no inner nodes) of a subtree of a given discrimination tree node.
-
Method Details
-
nodeIterator
Returns an iterator that traverses all nodes of a subtree of a given discrimination tree node.- Type Parameters:
N- node type- Parameters:
root- the root node, from which traversal should start- Returns:
- an iterator that traverses all nodes of a subtree of the given node
-
innerNodeIterator
Returns an iterator that traverses all inner nodes (no leaves) of a subtree of a given discrimination tree node.- Type Parameters:
N- node type- Parameters:
root- the root node, from which traversal should start- Returns:
- an iterator that traverses all inner nodes of a subtree of the given node
-
leafIterator
Returns an iterator that traverses all leaves (no inner nodes) of a subtree of a given discrimination tree node.- Type Parameters:
N- node type- Parameters:
root- the root node, from which traversal should start- Returns:
- an iterator that traverses all leaf nodes of a subtree of the given node
-
transformingLeafIterator
public static <N extends AbstractDTNode<?,?, Iterator<D> transformingLeafIterator?, N>, D> (N root, Function<? super N, D> transformer) Returns an iterator that traverses all leaves (no inner nodes) of a subtree of a given discrimination tree node. Additionally, allows one to specify a transformer that is applied to the leaf nodes- Type Parameters:
N- node typeD- transformation target data type- Parameters:
root- the root node, from which traversal should starttransformer- the transformer that transforms iterated nodes- Returns:
- an iterator that traverses all (transformed) leaf nodes of a subtree of the given node
-