T
- the implementation of IVertex used for all nodes.public abstract static class IGeneric.Visitor<T extends IGeneric<T>> extends Object
To indicate specific treatments before and after traversing a node, simply redefine respectively methods before
and after
.
Constructor and Description |
---|
Visitor() |
Modifier and Type | Method and Description |
---|---|
void |
after(T node)
Treatment performed after each node is traversed.
|
void |
before(T node)
Treatment performed before each node is traversed.
|
void |
traverse(T node)
Effectively traverse the tree from the specified
node . |
public void traverse(T node)
node
.node
- the node from which start traversing the tree.public void before(T node)
This implementation does nothing.
node
- the node to treat before traversed it.public void after(T node)
This implementation does nothing.
node
- the node to treat after traversed it.Copyright © 2022. All rights reserved.