Package com.google.common.graph
Class AbstractValueGraph<N,V>
- java.lang.Object
-
- com.google.common.graph.AbstractGraph<N>
-
- com.google.common.graph.AbstractValueGraph<N,V>
-
- Type Parameters:
N
- Node parameter typeV
- Value parameter type
- All Implemented Interfaces:
Graph<N>
,ValueGraph<N,V>
@Beta public abstract class AbstractValueGraph<N,V> extends AbstractGraph<N> implements ValueGraph<N,V>
This class provides a skeletal implementation ofValueGraph
. It is recommended to extend this class rather than implementValueGraph
directly.- Since:
- 20.0
-
-
Constructor Summary
Constructors Constructor Description AbstractValueGraph()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description V
edgeValue(java.lang.Object nodeU, java.lang.Object nodeV)
If there is an edge connectingnodeU
tonodeV
, returns the non-null value associated with that edge.java.lang.String
toString()
Returns a string representation of this graph.-
Methods inherited from class com.google.common.graph.AbstractGraph
degree, edgeCount, edges, inDegree, outDegree
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.common.graph.Graph
adjacentNodes, allowsSelfLoops, degree, edges, inDegree, isDirected, nodeOrder, nodes, outDegree, predecessors, successors
-
Methods inherited from interface com.google.common.graph.ValueGraph
edgeValueOrDefault, equals, hashCode
-
-
-
-
Method Detail
-
edgeValue
public V edgeValue(java.lang.Object nodeU, java.lang.Object nodeV)
Description copied from interface:ValueGraph
If there is an edge connectingnodeU
tonodeV
, returns the non-null value associated with that edge.In an undirected graph, this is equal to
edgeValue(nodeV, nodeU)
.- Specified by:
edgeValue
in interfaceValueGraph<N,V>
-
toString
public java.lang.String toString()
Returns a string representation of this graph.- Overrides:
toString
in classAbstractGraph<N>
-
-