Package com.google.common.graph
Class EndpointPairIterator<N>
- java.lang.Object
-
- com.google.common.collect.UnmodifiableIterator<T>
-
- com.google.common.collect.AbstractIterator<EndpointPair<N>>
-
- com.google.common.graph.EndpointPairIterator<N>
-
- All Implemented Interfaces:
java.util.Iterator<EndpointPair<N>>
- Direct Known Subclasses:
EndpointPairIterator.Directed
,EndpointPairIterator.Undirected
abstract class EndpointPairIterator<N> extends AbstractIterator<EndpointPair<N>>
A class to facilitate the set returned byGraph.edges()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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.
-
Field Summary
Fields Modifier and Type Field Description private Graph<N>
graph
protected N
node
private java.util.Iterator<N>
nodeIterator
protected java.util.Iterator<N>
successorIterator
-
Constructor Summary
Constructors Modifier Constructor Description private
EndpointPairIterator(Graph<N> graph)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
advance()
Called aftersuccessorIterator
is exhausted.(package private) static <N> EndpointPairIterator<N>
of(Graph<N> graph)
-
Methods inherited from class com.google.common.collect.AbstractIterator
computeNext, endOfData, hasNext, next, peek
-
Methods inherited from class com.google.common.collect.UnmodifiableIterator
remove
-
-
-
-
Method Detail
-
of
static <N> EndpointPairIterator<N> of(Graph<N> graph)
-
advance
protected final boolean advance()
Called aftersuccessorIterator
is exhausted. Advancesnode
to the next node and updatessuccessorIterator
to iterate through the successors ofnode
.
-
-