Top Description Constructors Methods
com.google.common.graph

public abstract Class AbstractGraph<N>

extends AbstractBaseGraph<N>
implements Graph<N>
Class Inheritance
All Implemented Interfaces
com.google.common.graph.Graph, com.google.common.graph.BaseGraph, com.google.common.graph.PredecessorsFunction, com.google.common.graph.SuccessorsFunction
Known Direct Subclasses
com.google.common.graph.ForwardingGraph
Annotations
@Beta
@ElementTypesAreNonnullByDefault
Type Parameters
<N>
Node parameter type
Imports
com.google.common.annotations.Beta, javax.annotation.CheckForNull

This class provides a skeletal implementation of Graph. It is recommended to extend this class rather than implement Graph directly.
Author
James Sexton
Since
20.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Implements com.google.common.graph.Graph.equals.

Returns true iff object is a Graph that has the same elements and the same structural relationships as those in this graph.
public final int
hashCode()

Overrides java.lang.Object.hashCode.

Implements com.google.common.graph.Graph.hashCode.

Returns the hash code for this graph.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of this graph.
Inherited from com.google.common.graph.AbstractBaseGraph:
degreeedgeCountedgeshasEdgeConnectinghasEdgeConnectingincidentEdgeOrderincidentEdgesinDegreeisOrderingCompatibleoutDegreevalidateEndpoints

Constructor Detail

AbstractGraphback to summary
public AbstractGraph()

Method Detail

equalsback to summary
public final boolean equals(Object obj)

Overrides java.lang.Object.equals.

Implements com.google.common.graph.Graph.equals.

Doc from com.google.common.graph.Graph.equals.

Returns 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:

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 AbstractGraph#equals(Object).

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
hashCodeback to summary
public final int hashCode()

Overrides java.lang.Object.hashCode.

Implements com.google.common.graph.Graph.hashCode.

Doc from com.google.common.graph.Graph.hashCode.

Returns the hash code for this graph. The hash code of a graph is defined as the hash code of the set returned by edges().

A reference implementation of this is provided by AbstractGraph#hashCode().

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this graph.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

Annotations
@Override