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:
Iterable<N>
- Enclosing class:
EndpointPair<N>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
Returnstrue
if thisEndpointPair
is an ordered pair (i.e.source()
If thisEndpointPair
EndpointPair.isOrdered()
, returns the node which is the source.target()
If thisEndpointPair
EndpointPair.isOrdered()
, returns the node which is the target.toString()
Methods inherited from class com.google.common.graph.EndpointPair
adjacentNode, iterator, nodeU, nodeV, of, of, ordered, unordered
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Unordered
-
-
Method Details
-
source
Description copied from class:EndpointPair
If thisEndpointPair
EndpointPair.isOrdered()
, returns the node which is the source.- Specified by:
source
in classEndpointPair<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
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
-