Interface TreeTraversal.Visitor
- All Known Subinterfaces:
TreeTraversal.SpanIntersectingVisitor
- All Known Implementing Classes:
AllPathsVisitor,AncestorsRelativeVisitor,AncestorsRootVisitor,CanonicalSuccessorsRelativeVisitor,OrderedSuccessorsVisitor,SuccessorsRelativeVisitor
- Enclosing class:
TreeTraversal
Traversal starts at a seed object or value (node or edge, respectively) and proceeds in
alternating fashion from object to value to object and so on via
continueObject(TraceObjectValue) and
continueValues(TraceObject, Lifespan, TraceObjectValPath). Filtering is performed on
values via visitValue(TraceObjectValue, TraceObjectValPath). As traversal descends,
paths and spans are composed to inform filtering and construct the final result stream. Note
that some traversals start at a seed and "descend" along the ancestry.
-
Method Summary
Modifier and TypeMethodDescriptioncomposePath(TraceObjectValPath pre, TraceObjectValue value) When descending in a value, what path leads to the valuecomposeSpan(Lifespan pre, TraceObjectValue value) When descending in a value, what span to consider in the subtreecontinueObject(TraceObjectValue value) When descending in a value, the object to consider nextStream<? extends TraceObjectValue> continueValues(TraceObject object, Lifespan span, TraceObjectValPath path) When descending in an object, the values to consider nextvisitValue(TraceObjectValue value, TraceObjectValPath path) Visit a value
-
Method Details
-
composeSpan
When descending in a value, what span to consider in the subtreeUsually this is intersection. See
TreeTraversal.SpanIntersectingVisitor- Parameters:
pre- the span composed from values from seed to but excluding the current valuevalue- the current value- Returns:
- the span composed from values from seed to and including the current value
-
composePath
When descending in a value, what path leads to the valueThis is usually
TraceObjectValPath.append(TraceObjectValue)orTraceObjectValPath.prepend(TraceObjectValue).- Parameters:
pre- the path from seed to the but excluding the current valuevalue- the path from seed to the and including the current value- Returns:
- the path from seed to and including the current value
-
visitValue
Visit a valueNote that the path is the composed path, so it will likely have the current value at its beginning or end.
- Parameters:
value- the current valuepath- the path from seed to value- Returns:
- directions for how traversal should proceed
-
continueObject
When descending in a value, the object to consider nextThis is usually
TraceObjectValue.getChild()orTraceObjectValue.getParent().- Parameters:
value- the current value- Returns:
- the next object
-
continueValues
Stream<? extends TraceObjectValue> continueValues(TraceObject object, Lifespan span, TraceObjectValPath path) When descending in an object, the values to consider next- Parameters:
object- the current objectspan- the composed span of values from seed to the current objectpath- the path from seed to the current object- Returns:
- the next values
-