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 classEndpointPairIterator.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 classEndpointPairIterator.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 BaseGraph<N>graphprotected Nnodeprivate java.util.Iterator<N>nodeIteratorprotected java.util.Iterator<N>successorIterator
-
Constructor Summary
Constructors Modifier Constructor Description privateEndpointPairIterator(BaseGraph<N> graph)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanadvance()Called aftersuccessorIteratoris exhausted.(package private) static <N> EndpointPairIterator<N>of(BaseGraph<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(BaseGraph<N> graph)
-
advance
protected final boolean advance()
Called aftersuccessorIteratoris exhausted. Advancesnodeto the next node and updatessuccessorIteratorto iterate through the successors ofnode.
-
-