Package com.google.common.graph
Class ImmutableGraph<N>
- java.lang.Object
-
- com.google.common.graph.AbstractBaseGraph<N>
-
- com.google.common.graph.AbstractGraph<N>
-
- com.google.common.graph.ForwardingGraph<N>
-
- com.google.common.graph.ImmutableGraph<N>
-
- Type Parameters:
N
- Node parameter type
- All Implemented Interfaces:
BaseGraph<N>
,Graph<N>
,PredecessorsFunction<N>
,SuccessorsFunction<N>
@Beta public class ImmutableGraph<N> extends ForwardingGraph<N>
AGraph
whose elements and structural relationships will never change. Instances of this class may be obtained withcopyOf(Graph)
.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
ImmutableGraph.Builder<N>
A builder for creatingImmutableGraph
instances, especiallystatic final
graphs.
-
Field Summary
Fields Modifier and Type Field Description private BaseGraph<N>
backingGraph
-
Constructor Summary
Constructors Constructor Description ImmutableGraph(BaseGraph<N> backingGraph)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private static <N> GraphConnections<N,GraphConstants.Presence>
connectionsOf(Graph<N> graph, N node)
static <N> ImmutableGraph<N>
copyOf(Graph<N> graph)
Returns an immutable copy ofgraph
.static <N> ImmutableGraph<N>
copyOf(ImmutableGraph<N> graph)
Deprecated.no need to use thisprotected BaseGraph<N>
delegate()
private static <N> ImmutableMap<N,GraphConnections<N,GraphConstants.Presence>>
getNodeConnections(Graph<N> graph)
-
Methods inherited from class com.google.common.graph.ForwardingGraph
adjacentNodes, allowsSelfLoops, degree, edgeCount, hasEdgeConnecting, hasEdgeConnecting, inDegree, isDirected, nodeOrder, nodes, outDegree, predecessors, successors
-
Methods inherited from class com.google.common.graph.AbstractGraph
equals, hashCode, toString
-
Methods inherited from class com.google.common.graph.AbstractBaseGraph
edges, incidentEdges, isOrderingCompatible, validateEndpoints
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.common.graph.Graph
edges, incidentEdges
-
-
-
-
Method Detail
-
copyOf
public static <N> ImmutableGraph<N> copyOf(Graph<N> graph)
Returns an immutable copy ofgraph
.
-
copyOf
@Deprecated public static <N> ImmutableGraph<N> copyOf(ImmutableGraph<N> graph)
Deprecated.no need to use thisSimply returns its argument.
-
getNodeConnections
private static <N> ImmutableMap<N,GraphConnections<N,GraphConstants.Presence>> getNodeConnections(Graph<N> graph)
-
connectionsOf
private static <N> GraphConnections<N,GraphConstants.Presence> connectionsOf(Graph<N> graph, N node)
-
delegate
protected BaseGraph<N> delegate()
- Specified by:
delegate
in classForwardingGraph<N>
-
-