abstract class EndpointPairIterator<N> extends AbstractIterator<EndpointPair<N>>
Graph.edges()
.Modifier and Type | Class and Description |
---|---|
private static class |
EndpointPairIterator.Directed<N>
If the graph is directed, each ordered [source, target] pair will be visited once if there is
an edge connecting them.
|
private static class |
EndpointPairIterator.Undirected<N>
If the graph is undirected, each unordered [node, otherNode] pair (except self-loops) will be
visited twice if there is an edge connecting them.
|
Modifier and Type | Field and Description |
---|---|
private Graph<N> |
graph |
protected N |
node |
private java.util.Iterator<N> |
nodeIterator |
protected java.util.Iterator<N> |
successorIterator |
Modifier | Constructor and Description |
---|---|
private |
EndpointPairIterator(Graph<N> graph) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
advance()
Called after
successorIterator is exhausted. |
(package private) static <N> EndpointPairIterator<N> |
of(Graph<N> graph) |
computeNext, endOfData, hasNext, next, peek
remove
private final java.util.Iterator<N> nodeIterator
protected N node
protected java.util.Iterator<N> successorIterator
static <N> EndpointPairIterator<N> of(Graph<N> graph)
protected final boolean advance()
successorIterator
is exhausted. Advances node
to the next node
and updates successorIterator
to iterate through the successors of node
.