N
- Node parameter typeV
- Value parameter type@Beta public final class ImmutableValueGraph<N,V> extends ImmutableGraph.ValueBackedImpl<N,V> implements ValueGraph<N,V>
ValueGraph
whose elements and structural relationships will never change. Instances of
this class may be obtained with copyOf(ValueGraph)
.
See the Guava User's Guide's discussion
of the Immutable*
types for more information on the properties and guarantees
provided by this class.
ImmutableGraph.ValueBackedImpl<N,V>
backingValueGraph
Modifier | Constructor and Description |
---|---|
private |
ImmutableValueGraph(ValueGraph<N,V> graph) |
Modifier and Type | Method and Description |
---|---|
private static <N,V> GraphConnections<N,V> |
connectionsOf(ValueGraph<N,V> graph,
N node) |
static <N,V> ImmutableValueGraph<N,V> |
copyOf(ImmutableValueGraph<N,V> graph)
Deprecated.
no need to use this
|
static <N,V> ImmutableValueGraph<N,V> |
copyOf(ValueGraph<N,V> graph)
Returns an immutable copy of
graph . |
V |
edgeValue(java.lang.Object nodeU,
java.lang.Object nodeV)
If there is an edge connecting
nodeU to nodeV , returns the non-null value
associated with that edge. |
V |
edgeValueOrDefault(java.lang.Object nodeU,
java.lang.Object nodeV,
V defaultValue)
If there is an edge connecting
nodeU to nodeV , returns the non-null value
associated with that edge; otherwise, returns defaultValue . |
private static <N,V> ImmutableMap<N,GraphConnections<N,V>> |
getNodeConnections(ValueGraph<N,V> graph) |
java.lang.String |
toString()
Returns a string representation of this graph.
|
delegate
copyOf, copyOf
adjacentNodes, allowsSelfLoops, degree, edges, inDegree, isDirected, nodeOrder, nodes, outDegree, predecessors, successors
edgeCount
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode
adjacentNodes, allowsSelfLoops, degree, edges, inDegree, isDirected, nodeOrder, nodes, outDegree, predecessors, successors
private ImmutableValueGraph(ValueGraph<N,V> graph)
public static <N,V> ImmutableValueGraph<N,V> copyOf(ValueGraph<N,V> graph)
graph
.@Deprecated public static <N,V> ImmutableValueGraph<N,V> copyOf(ImmutableValueGraph<N,V> graph)
private static <N,V> ImmutableMap<N,GraphConnections<N,V>> getNodeConnections(ValueGraph<N,V> graph)
private static <N,V> GraphConnections<N,V> connectionsOf(ValueGraph<N,V> graph, N node)
public V edgeValue(java.lang.Object nodeU, java.lang.Object nodeV)
ValueGraph
nodeU
to nodeV
, returns the non-null value
associated with that edge.
In an undirected graph, this is equal to edgeValue(nodeV, nodeU)
.
edgeValue
in interface ValueGraph<N,V>
public V edgeValueOrDefault(java.lang.Object nodeU, java.lang.Object nodeV, @Nullable V defaultValue)
ValueGraph
nodeU
to nodeV
, returns the non-null value
associated with that edge; otherwise, returns defaultValue
.
In an undirected graph, this is equal to edgeValueOrDefault(nodeV, nodeU,
defaultValue)
.
edgeValueOrDefault
in interface ValueGraph<N,V>
public java.lang.String toString()
AbstractGraph
toString
in class AbstractGraph<N>