N
- Node parameter typepublic class ImmutableGraph<N> extends ForwardingGraph<N>
Graph
whose elements and structural relationships will never change. Instances of this
class may be obtained with copyOf(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.
Modifier and Type | Class and Description |
---|---|
static class |
ImmutableGraph.Builder<N>
A builder for creating
ImmutableGraph instances, especially static final
graphs. |
Modifier and Type | Field and Description |
---|---|
private BaseGraph<N> |
backingGraph |
Constructor and Description |
---|
ImmutableGraph(BaseGraph<N> backingGraph) |
Modifier and Type | Method and 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 of
graph . |
static <N> ImmutableGraph<N> |
copyOf(ImmutableGraph<N> graph)
Deprecated.
no need to use this
|
(package private) BaseGraph<N> |
delegate() |
private static <N> ImmutableMap<N,GraphConnections<N,GraphConstants.Presence>> |
getNodeConnections(Graph<N> graph) |
ElementOrder<N> |
incidentEdgeOrder()
Returns an
ElementOrder that specifies the order of iteration for the elements of
BaseGraph.edges() , BaseGraph.adjacentNodes(Object) , BaseGraph.predecessors(Object) , BaseGraph.successors(Object) and BaseGraph.incidentEdges(Object) . |
adjacentNodes, allowsSelfLoops, degree, edgeCount, hasEdgeConnecting, hasEdgeConnecting, incidentEdges, inDegree, isDirected, nodeOrder, nodes, outDegree, predecessors, successors
equals, hashCode, toString
edges, isOrderingCompatible, validateEndpoints
public static <N> ImmutableGraph<N> copyOf(Graph<N> graph)
graph
.@Deprecated public static <N> ImmutableGraph<N> copyOf(ImmutableGraph<N> graph)
public ElementOrder<N> incidentEdgeOrder()
BaseGraph
ElementOrder
that specifies the order of iteration for the elements of
BaseGraph.edges()
, BaseGraph.adjacentNodes(Object)
, BaseGraph.predecessors(Object)
, BaseGraph.successors(Object)
and BaseGraph.incidentEdges(Object)
.incidentEdgeOrder
in interface BaseGraph<N>
incidentEdgeOrder
in interface Graph<N>
incidentEdgeOrder
in class ForwardingGraph<N>
private static <N> ImmutableMap<N,GraphConnections<N,GraphConstants.Presence>> getNodeConnections(Graph<N> graph)
private static <N> GraphConnections<N,GraphConstants.Presence> connectionsOf(Graph<N> graph, N node)
BaseGraph<N> delegate()
delegate
in class ForwardingGraph<N>