Package com.google.common.graph
Class EndpointPair.Unordered<N>
- java.lang.Object
-
- com.google.common.graph.EndpointPair<N>
-
- com.google.common.graph.EndpointPair.Unordered<N>
-
- All Implemented Interfaces:
java.lang.Iterable<N>
- Enclosing class:
- EndpointPair<N>
private static final class EndpointPair.Unordered<N> extends EndpointPair<N>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Two orderedEndpointPairs are equal if theirEndpointPair.source()andEndpointPair.target()are equal.inthashCode()The hashcode of an orderedEndpointPairis equal toObjects.hashCode(source(), target()).booleanisOrdered()Returnstrueif thisEndpointPairis an ordered pair (i.e.Nsource()If thisEndpointPairEndpointPair.isOrdered(), returns the node which is the source.Ntarget()If thisEndpointPairEndpointPair.isOrdered(), returns the node which is the target.java.lang.StringtoString()-
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:EndpointPairIf thisEndpointPairEndpointPair.isOrdered(), returns the node which is the source.- Specified by:
sourcein classEndpointPair<N>
-
target
public N target()
Description copied from class:EndpointPairIf thisEndpointPairEndpointPair.isOrdered(), returns the node which is the target.- Specified by:
targetin classEndpointPair<N>
-
isOrdered
public boolean isOrdered()
Description copied from class:EndpointPairReturnstrueif thisEndpointPairis an ordered pair (i.e. represents the endpoints of a directed edge).- Specified by:
isOrderedin classEndpointPair<N>
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:EndpointPairTwo orderedEndpointPairs are equal if theirEndpointPair.source()andEndpointPair.target()are equal. Two unorderedEndpointPairs are equal if they contain the same nodes. An orderedEndpointPairis never equal to an unorderedEndpointPair.- Specified by:
equalsin classEndpointPair<N>
-
hashCode
public int hashCode()
Description copied from class:EndpointPairThe hashcode of an orderedEndpointPairis equal toObjects.hashCode(source(), target()). The hashcode of an unorderedEndpointPairis equal tonodeU().hashCode() + nodeV().hashCode().- Specified by:
hashCodein classEndpointPair<N>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-