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.StandardValueGraph<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>
public final class ImmutableValueGraph<N,V> extends StandardValueGraph<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.StandardValueGraph
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)
ElementOrder<N>
incidentEdgeOrder()
Returns anElementOrder
that specifies the order of iteration for the elements ofBaseGraph.edges()
,BaseGraph.adjacentNodes(Object)
,BaseGraph.predecessors(Object)
,BaseGraph.successors(Object)
andBaseGraph.incidentEdges(Object)
.-
Methods inherited from class com.google.common.graph.StandardValueGraph
adjacentNodes, allowsSelfLoops, containsNode, edgeCount, edgeValueOrDefault, edgeValueOrDefault, hasEdgeConnecting, hasEdgeConnecting, incidentEdges, 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, 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, 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.
-
incidentEdgeOrder
public ElementOrder<N> incidentEdgeOrder()
Description copied from interface:BaseGraph
Returns anElementOrder
that specifies the order of iteration for the elements ofBaseGraph.edges()
,BaseGraph.adjacentNodes(Object)
,BaseGraph.predecessors(Object)
,BaseGraph.successors(Object)
andBaseGraph.incidentEdges(Object)
.- Specified by:
incidentEdgeOrder
in interfaceBaseGraph<N>
- Specified by:
incidentEdgeOrder
in interfaceValueGraph<N,V>
- Overrides:
incidentEdgeOrder
in classAbstractBaseGraph<N>
-
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)
-
-