Package com.google.common.graph
Class EndpointPair.Ordered<N>
- java.lang.Object
-
- com.google.common.graph.EndpointPair<N>
-
- com.google.common.graph.EndpointPair.Ordered<N>
-
- All Implemented Interfaces:
java.lang.Iterable<N>
- Enclosing class:
- EndpointPair<N>
private static final class EndpointPair.Ordered<N> extends EndpointPair<N>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Two orderedEndpointPair
s are equal if theirEndpointPair.source()
andEndpointPair.target()
are equal.int
hashCode()
The hashcode of an orderedEndpointPair
is equal toObjects.hashCode(source(), target())
.boolean
isOrdered()
Returnstrue
if thisEndpointPair
is an ordered pair (i.e.N
source()
If thisEndpointPair
EndpointPair.isOrdered()
, returns the node which is the source.N
target()
If thisEndpointPair
EndpointPair.isOrdered()
, returns the node which is the target.java.lang.String
toString()
-
Methods inherited from class com.google.common.graph.EndpointPair
adjacentNode, iterator, nodeU, nodeV, of, of, ordered, unordered
-
-
-
-
Method Detail
-
source
public N source()
Description copied from class:EndpointPair
If thisEndpointPair
EndpointPair.isOrdered()
, returns the node which is the source.- Specified by:
source
in classEndpointPair<N>
-
target
public N target()
Description copied from class:EndpointPair
If thisEndpointPair
EndpointPair.isOrdered()
, returns the node which is the target.- Specified by:
target
in classEndpointPair<N>
-
isOrdered
public boolean isOrdered()
Description copied from class:EndpointPair
Returnstrue
if thisEndpointPair
is an ordered pair (i.e. represents the endpoints of a directed edge).- Specified by:
isOrdered
in classEndpointPair<N>
-
equals
public boolean equals(@Nullable java.lang.Object obj)
Description copied from class:EndpointPair
Two orderedEndpointPair
s are equal if theirEndpointPair.source()
andEndpointPair.target()
are equal. Two unorderedEndpointPair
s are equal if they contain the same nodes. An orderedEndpointPair
is never equal to an unorderedEndpointPair
.- Specified by:
equals
in classEndpointPair<N>
-
hashCode
public int hashCode()
Description copied from class:EndpointPair
The hashcode of an orderedEndpointPair
is equal toObjects.hashCode(source(), target())
. The hashcode of an unorderedEndpointPair
is equal tonodeU().hashCode() + nodeV().hashCode()
.- Specified by:
hashCode
in classEndpointPair<N>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-