public final class OutlineNodes extends Object
OutlineNode
s.Modifier and Type | Method and Description |
---|---|
static <N extends OutlineNode<N>> |
findLastDescendant(N n)
Return the last descendant of this node in traversal order.
|
static <N extends OutlineNode<N>> |
findNext(N n)
Find the next OutlineNode in a depth-first traversal order of the node tree.
|
static <N extends OutlineNode<N>> |
findNext(N n,
boolean descend,
boolean ascend)
Find the next OutlineNode in a depth-first traversal order of the node tree.
|
static <N extends OutlineNode<N>> |
findPrevious(N n)
Find the previous OutlineNode in a depth-first traversal order of the node tree.
|
static <N extends OutlineNode<N>> |
findPrevious(N n,
boolean descend,
boolean ascend)
Find the previous OutlineNode in a depth-first traversal order of the node tree.
|
static void |
visit(OutlineNode<?> node,
OutlineVisitor visitor)
Starts the visiting process for the given
OutlineVisitor and node. |
public static <N extends OutlineNode<N>> N findNext(N n)
null
is returned, indicating that there is no next noden
- the node from which to startnull
if there is no next nodepublic static <N extends OutlineNode<N>> N findNext(N n, boolean descend, boolean ascend)
true
and the given node has children, the first child of n is
selected as the next node
true
and the given node has neither children nor a next sibling
but a parent, the parent of n is selected as the next node
n
- the node from which to startdescend
- whether to descend in the tree looking for the next nodeascend
- whether to ascend in the tree looking for the next nodenull
if there is no next nodepublic static <N extends OutlineNode<N>> N findPrevious(N n)
null
is returned, indicating that there is no next nodenull
if there is no next nodepublic static <N extends OutlineNode<N>> N findPrevious(N n, boolean descend, boolean ascend)
ascend
-flag controls the traversal: if ascend is true
and the given
node does not have a preceding sibling but a parent, the parent of n is selected as the next
nodeascend
- whether to ascend in the tree looking for the next nodenull
if there is no next nodepublic static <N extends OutlineNode<N>> N findLastDescendant(N n)
public static void visit(OutlineNode<?> node, OutlineVisitor visitor)
OutlineVisitor
and node. The visitor can
control the traversal process by returning the appropriate OutlineVisitor.VisitResult
s
for each node it visits.node
- the node/outlinevisitor
- the visitorCopyright © 2024 levigo holding gmbh. All rights reserved.