T
- Resul of traversal@Beta @PublicAPI public interface PostOrderDfsVisitor<T>
Instances of this interface can be passed to
Util.traversePostOrderDFS(com.chemaxon.clustering.util.PostOrderDfsVisitor,
com.chemaxon.clustering.common.IDBasedHierarchicClustering)
An instance of this interface represents the mutable state of a post order DFS tree traversal.
visit(com.chemaxon.clustering.common.IDBasedHierarchicCluster, java.util.List, int)
represents the
visit of the clusters.
Traversal is done according the order in the structure. Each cluster is visited at most once. Visit invoked as soon as possible: either when all children visited or when children visit skip signalled.
Please note that this interface is marked with Beta
annotation, so it can be subject of incompatible
changes or removal in later releases.
Modifier and Type | Method and Description |
---|---|
boolean |
skipChildTraversal(IDBasedHierarchicCluster cluster,
int depth)
Decide if a cluster's children should be traversed.
|
T |
visit(IDBasedHierarchicCluster cluster,
List<T> childResults,
int depth)
Visit a cluster.
|
boolean skipChildTraversal(IDBasedHierarchicCluster cluster, int depth)
If a child traversal is skipped the the actual cluster is immediately visited by invoking
visit(com.chemaxon.clustering.common.IDBasedHierarchicCluster, java.util.List, int)
cluster
- Cluster to visitdepth
- Visited node depth, distance from a root (0 for the root, 1 for its immediate children)true
when the given cluster's children should not be traversed.T visit(IDBasedHierarchicCluster cluster, List<T> childResults, int depth)
cluster
- Cluster to visitchildResults
- Immutable list of the result of the children visits or null when children traversal is
skipepd by true
returned value from
skipChildTraversal(com.chemaxon.clustering.common.IDBasedHierarchicCluster, int)
depth
- Visited node depth, distance from a root (0 for the root, 1 for its immediate children)