public class Visits extends Object
| Modifier and Type | Method and Description |
|---|---|
static <S,R> R |
visit(Iterable<? super S> container,
IVisitor<S,R> visitor)
Visits container and its children pre-order (parent first).
|
static <S,R> R |
visit(Iterable<? super S> container,
IVisitor<S,R> visitor,
IVisitFilter filter)
Visits container and its children pre-order (parent first).
|
static <S,R> R |
visitChildren(Iterable<? super S> container,
IVisitor<S,R> visitor)
Visits children of the specified
Iterable pre-order (parent first). |
static <S,R> R |
visitChildren(Iterable<? super S> container,
IVisitor<S,R> visitor,
IVisitFilter filter)
Visits children of the specified
Iterable pre-order (parent first). |
static <S,R> R |
visitPostOrder(Object root,
IVisitor<S,R> visitor,
IVisitFilter filter)
Visits the specified object and any of its children using a post-order (child first)
traversal.
|
static <S,R> R |
visitPostOrder(S root,
IVisitor<S,R> visitor)
Visits the specified object and any of its children using a post-order (child first)
traversal.
|
public static <S,R> R visit(Iterable<? super S> container, IVisitor<S,R> visitor)
Iterable.iterator().S - the type of object that will be visited, notice that container is not
declared as Iterable<S> because it may return a generalization of
SR - the type of object that should be returned from the visitor, use Void if
no return value is neededcontainer - object whose children will be visitedvisitor - the visitorvisitor or null if nonepublic static <S,R> R visit(Iterable<? super S> container, IVisitor<S,R> visitor, IVisitFilter filter)
Iterable.iterator().S - the type of object that will be visited, notice that container is not
declared as Iterable<S> because it may return a generalization of
SR - the type of object that should be returned from the visitor, use Void if
no return value is neededcontainer - object whose children will be visitedvisitor - the visitorfilter - filter used to limit the types of objects that will be visitedvisitor or null if nonepublic static <S,R> R visitChildren(Iterable<? super S> container, IVisitor<S,R> visitor, IVisitFilter filter)
Iterable pre-order (parent first). Children are
determined by calling Iterable.iterator().S - the type of object that will be visited, notice that container is not
declared as Iterable<S> because it may return a generalization of
SR - the type of object that should be returned from the visitor, use Void if
no return value is neededcontainer - object whose children will be visitedvisitor - the visitorfilter - filter used to limit the types of objects that will be visitedvisitor or null if nonepublic static <S,R> R visitChildren(Iterable<? super S> container, IVisitor<S,R> visitor)
Iterable pre-order (parent first). Children are
determined by calling Iterable.iterator().S - the type of object that will be visited, notice that container is not
declared as Iterable<S> because it may return a generalization of
SR - the type of object that should be returned from the visitor, use Void if
no return value is neededcontainer - object whose children will be visitedvisitor - the visitorvisitor or null if nonepublic static <S,R> R visitPostOrder(S root,
IVisitor<S,R> visitor)
Iterable.iterator() if the object
implements Iterable.S - the type of object that will be visited, notice that container is not
declared as Iterable<S> because it may return a generalization of
SR - the type of object that should be returned from the visitor, use Void if
no return value is neededroot - root object that will be visitedvisitor - the visitorvisitor or null if nonepublic static <S,R> R visitPostOrder(Object root, IVisitor<S,R> visitor, IVisitFilter filter)
Iterable.iterator() if the object
implements Iterable.S - the type of object that will be visited, notice that container is not
declared as Iterable<S> because it may return a generalization of
SR - the type of object that should be returned from the visitor, use Void if
no return value is neededroot - root object that will be visitedvisitor - the visitorfilter - filter used to limit the types of objects that will be visitedvisitor or null if noneCopyright © 2006–2014 Apache Software Foundation. All rights reserved.