public class SortedDepthFirstIterator<V,E>
extends org.jgrapht.traverse.AbstractGraphIterator<V,E>
I had to copy-paste whole sections of JGraphT code to make this one: I could not extend the desired class, for the interesting method and field were private.
Modifier and Type | Field and Description |
---|---|
protected Comparator<V> |
comparator |
protected Map<V,fiji.plugin.trackmate.graph.SortedDepthFirstIterator.VisitColor> |
seen
Stores the vertices that have been seen during iteration and (optionally)
some additional traversal info regarding each vertex.
|
protected fiji.plugin.trackmate.graph.SortedDepthFirstIterator.Specifics<V,E> |
specifics |
Constructor and Description |
---|
SortedDepthFirstIterator(org.jgrapht.Graph<V,E> g,
V startVertex,
Comparator<V> comparator)
Creates a new iterator for the specified graph.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addUnseenChildrenOf(V vertex)
This is where we add the multiple children in proper sorted order.
|
protected void |
encounterVertex(V vertex,
E edge) |
protected void |
encounterVertexAgain(V vertex,
E edge) |
boolean |
hasNext() |
V |
next() |
addTraversalListener, createEdgeTraversalEvent, createVertexTraversalEvent, fireConnectedComponentFinished, fireConnectedComponentStarted, fireEdgeTraversed, fireVertexFinished, fireVertexTraversed, getGraph, isCrossComponentTraversal, isReuseEvents, remove, removeTraversalListener, setCrossComponentTraversal, setReuseEvents
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
protected Map<V,fiji.plugin.trackmate.graph.SortedDepthFirstIterator.VisitColor> seen
protected fiji.plugin.trackmate.graph.SortedDepthFirstIterator.Specifics<V,E> specifics
protected final Comparator<V> comparator
public SortedDepthFirstIterator(org.jgrapht.Graph<V,E> g, V startVertex, Comparator<V> comparator)
null
, Iteration will start at an arbitrary graph vertex.g
- the graph to be iterated.startVertex
- the vertex iteration to be started.IllegalArgumentException
- if g==null
or does not contain
startVertex
public boolean hasNext()
Iterator.hasNext()
public V next()
Iterator.next()
protected void addUnseenChildrenOf(V vertex)
Copyright © 2015–2021 Fiji. All rights reserved.