Package com.google.common.graph
Class ImmutableValueGraph<N,V>
- java.lang.Object
-
- com.google.common.graph.AbstractBaseGraph<N>
-
- com.google.common.graph.AbstractValueGraph<N,V>
-
- com.google.common.graph.ConfigurableValueGraph<N,V>
-
- com.google.common.graph.ImmutableValueGraph<N,V>
-
- Type Parameters:
N
- Node parameter typeV
- Value parameter type
- All Implemented Interfaces:
BaseGraph<N>
,PredecessorsFunction<N>
,SuccessorsFunction<N>
,ValueGraph<N,V>
@Beta public final class ImmutableValueGraph<N,V> extends ConfigurableValueGraph<N,V>
AValueGraph
whose elements and structural relationships will never change. Instances of this class may be obtained withcopyOf(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.- Since:
- 20.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableValueGraph.Builder<N,V>
A builder for creatingImmutableValueGraph
instances, especiallystatic final
graphs.
-
Field Summary
-
Fields inherited from class com.google.common.graph.ConfigurableValueGraph
edgeCount, nodeConnections
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ImmutableValueGraph(ValueGraph<N,V> graph)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ImmutableGraph<N>
asGraph()
Returns a live view of this graph as aGraph
.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 thisstatic <N,V>
ImmutableValueGraph<N,V>copyOf(ValueGraph<N,V> graph)
Returns an immutable copy ofgraph
.private static <N,V>
ImmutableMap<N,GraphConnections<N,V>>getNodeConnections(ValueGraph<N,V> graph)
-
Methods inherited from class com.google.common.graph.ConfigurableValueGraph
adjacentNodes, allowsSelfLoops, checkedConnections, containsNode, edgeCount, edgeValueOrDefault, edgeValueOrDefault, edgeValueOrDefault_internal, hasEdgeConnecting, hasEdgeConnecting, hasEdgeConnecting_internal, isDirected, nodeOrder, nodes, predecessors, successors
-
Methods inherited from class com.google.common.graph.AbstractValueGraph
edgeValue, edgeValue, equals, hashCode, toString
-
Methods inherited from class com.google.common.graph.AbstractBaseGraph
degree, edges, incidentEdges, inDegree, isOrderingCompatible, outDegree, validateEndpoints
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.common.graph.ValueGraph
degree, edges, incidentEdges, inDegree, outDegree
-
-
-
-
Constructor Detail
-
ImmutableValueGraph
private ImmutableValueGraph(ValueGraph<N,V> graph)
-
-
Method Detail
-
copyOf
public static <N,V> ImmutableValueGraph<N,V> copyOf(ValueGraph<N,V> graph)
Returns an immutable copy ofgraph
.
-
copyOf
@Deprecated public static <N,V> ImmutableValueGraph<N,V> copyOf(ImmutableValueGraph<N,V> graph)
Deprecated.no need to use thisSimply returns its argument.
-
asGraph
public ImmutableGraph<N> asGraph()
Description copied from interface:ValueGraph
Returns a live view of this graph as aGraph
. The resultingGraph
will have an edge connecting node A to node B if thisValueGraph
has an edge connecting A to B.- Specified by:
asGraph
in interfaceValueGraph<N,V>
- Overrides:
asGraph
in classAbstractValueGraph<N,V>
-
getNodeConnections
private static <N,V> ImmutableMap<N,GraphConnections<N,V>> getNodeConnections(ValueGraph<N,V> graph)
-
connectionsOf
private static <N,V> GraphConnections<N,V> connectionsOf(ValueGraph<N,V> graph, N node)
-
-