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 BaseGraph<N> |
graph |
(package private) N |
node |
private java.util.Iterator<N> |
nodeIterator |
(package private) java.util.Iterator<N> |
successorIterator |
| Modifier | Constructor and Description |
|---|---|
private |
EndpointPairIterator(BaseGraph<N> graph) |
| Modifier and Type | Method and Description |
|---|---|
(package private) boolean |
advance()
Called after
successorIterator is exhausted. |
(package private) static <N> EndpointPairIterator<N> |
of(BaseGraph<N> graph) |
computeNext, endOfData, hasNext, next, peekremoveprivate final java.util.Iterator<N> nodeIterator
@CheckForNull N node
java.util.Iterator<N> successorIterator
static <N> EndpointPairIterator<N> of(BaseGraph<N> graph)
final boolean advance()
successorIterator is exhausted. Advances node to the next node
and updates successorIterator to iterate through the successors of node.