@Beta public abstract class EndpointPair<N> extends Object implements Iterable<N>
EndpointPair
 of a directed edge is an ordered pair of nodes (source() and target()). The
 EndpointPair of an undirected edge is an unordered pair of nodes (nodeU() and
 nodeV()).
 The edge is a self-loop if, and only if, the two endpoints are equal.
| Modifier and Type | Method and Description | 
|---|---|
| N | adjacentNode(Object node)Returns the node that is adjacent to  nodealong the origin edge. | 
| abstract boolean | equals(Object obj) | 
| abstract int | hashCode()The hashcode of an ordered  EndpointPairis equal toObjects.hashCode(source(),
 target()). | 
| abstract boolean | isOrdered()Returns  trueif thisEndpointPairis an ordered pair (i.e. | 
| UnmodifiableIterator<N> | iterator() | 
| N | nodeU()If this  EndpointPairisOrdered()returns thesource(); otherwise,
 returns an arbitrary (but consistent) endpoint of the origin edge. | 
| N | nodeV() | 
| static <N> EndpointPair<N> | ordered(N source,
       N target)Returns an  EndpointPairrepresenting the endpoints of a directed edge. | 
| abstract N | source()If this  EndpointPairisOrdered(), returns the node which is the source. | 
| abstract N | target()If this  EndpointPairisOrdered(), returns the node which is the target. | 
| static <N> EndpointPair<N> | unordered(N nodeU,
         N nodeV)Returns an  EndpointPairrepresenting the endpoints of an undirected edge. | 
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static <N> EndpointPair<N> ordered(N source, N target)
EndpointPair representing the endpoints of a directed edge.public static <N> EndpointPair<N> unordered(N nodeU, N nodeV)
EndpointPair representing the endpoints of an undirected edge.public abstract N source()
EndpointPair isOrdered(), returns the node which is the source.UnsupportedOperationException - if this EndpointPair is not orderedpublic abstract N target()
EndpointPair isOrdered(), returns the node which is the target.UnsupportedOperationException - if this EndpointPair is not orderedpublic final N nodeU()
EndpointPair isOrdered() returns the source(); otherwise,
 returns an arbitrary (but consistent) endpoint of the origin edge.public final N nodeV()
adjacent to nodeU() along the origin
 edge. If this EndpointPair isOrdered(), this is equal to target().public final N adjacentNode(Object node)
node along the origin edge.IllegalArgumentException - if this EndpointPair does not contain nodepublic abstract boolean isOrdered()
true if this EndpointPair is an ordered pair (i.e. represents the
 endpoints of a directed edge).public final UnmodifiableIterator<N> iterator()
public abstract boolean equals(@Nullable Object obj)
EndpointPairs are equal if their source() and target()
 are equal. Two unordered EndpointPairs are equal if they contain the same nodes. An
 ordered EndpointPair is never equal to an unordered EndpointPair.public abstract int hashCode()
EndpointPair is equal to Objects.hashCode(source(),
 target()). The hashcode of an unordered EndpointPair is equal to nodeU().hashCode() + nodeV().hashCode().Copyright © 2010-2017. All Rights Reserved.