Class Visitors<N>
java.lang.Object
ch.tocco.nice2.toolbox.api.collection.Visitors<N>
- Direct Known Subclasses:
NodeVisitors
Abstract class that implements visiting code. Two callbacks must be provided for those algorithms, one to
retrieve the parent of a node and and the other to get children of a node.
This class is meant to be overriden to apply concrete logic. See
ch.tocco.nice2.dbrefactoring.model.NodeVisitors
for an example.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static class
static interface
static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected <R> R
visitChildren
(Visitors.ChildrenCallback<N> childrenCallback, N node, NodeVisitor<N, R> visitor) protected <R> R
visitChildren
(Visitors.ChildrenCallback<N> childrenCallback, N node, NodeVisitor<N, R> visitor, Predicate<N> predicate) protected <R> R
visitParents
(Visitors.ParentCallback<N> parentCallback, N node, NodeVisitor<N, R> visitor) protected <R> R
visitParents
(Visitors.ParentCallback<N> parentCallback, N node, NodeVisitor<N, R> visitor, Predicate<N> predicate)
-
Constructor Details
-
Visitors
public Visitors()
-
-
Method Details
-
visitParents
protected <R> R visitParents(Visitors.ParentCallback<N> parentCallback, N node, NodeVisitor<N, R> visitor) -
visitParents
protected <R> R visitParents(Visitors.ParentCallback<N> parentCallback, N node, NodeVisitor<N, R> visitor, Predicate<N> predicate) -
visitChildren
protected <R> R visitChildren(Visitors.ChildrenCallback<N> childrenCallback, N node, NodeVisitor<N, R> visitor) -
visitChildren
protected <R> R visitChildren(Visitors.ChildrenCallback<N> childrenCallback, N node, NodeVisitor<N, R> visitor, Predicate<N> predicate)
-