N
- Node parameter type@Beta public abstract class AbstractGraph<N> extends AbstractBaseGraph<N> implements Graph<N>
Graph
. It is recommended to extend this
class rather than implement Graph
directly.Constructor and Description |
---|
AbstractGraph() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Returns
true iff object is a Graph that has the same elements and the
same structural relationships as those in this graph. |
int |
hashCode()
Returns the hash code for this graph.
|
java.lang.String |
toString()
Returns a string representation of this graph.
|
degree, edgeCount, edges, hasEdgeConnecting, incidentEdges, inDegree, outDegree
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
adjacentNodes, allowsSelfLoops, degree, edges, hasEdgeConnecting, incidentEdges, inDegree, isDirected, nodeOrder, nodes, outDegree, predecessors, successors
public final boolean equals(java.lang.Object obj)
Graph
true
iff object
is a Graph
that has the same elements and the
same structural relationships as those in this graph.
Thus, two graphs A and B are equal if all of the following are true:
directedness
.
node sets
.
edge sets
.
Graph properties besides directedness
do not affect equality.
For example, two graphs may be considered equal even if one allows self-loops and the other
doesn't. Additionally, the order in which nodes or edges are added to the graph, and the order
in which they are iterated over, are irrelevant.
A reference implementation of this is provided by equals(Object)
.
public final int hashCode()
Graph
Graph.edges()
.
A reference implementation of this is provided by hashCode()
.
public java.lang.String toString()
toString
in class java.lang.Object