Package com.google.common.graph
Class ImmutableNetwork<N,E>
java.lang.Object
com.google.common.graph.AbstractNetwork<N,E>
com.google.common.graph.StandardNetwork<N,E>
com.google.common.graph.ImmutableNetwork<N,E>
- Type Parameters:
N
- Node parameter typeE
- Edge parameter type
- All Implemented Interfaces:
Network<N,
,E> PredecessorsFunction<N>
,SuccessorsFunction<N>
A
Network
whose elements and structural relationships will never change. Instances of
this class may be obtained with copyOf(Network)
.
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 ClassesModifier and TypeClassDescriptionstatic class
A builder for creatingImmutableNetwork
instances, especiallystatic final
networks. -
Field Summary
Fields inherited from class com.google.common.graph.StandardNetwork
edgeToReferenceNode, nodeConnections
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <N,
E> Function <E, N> adjacentNodeFn
(Network<N, E> network, N node) asGraph()
Returns a live view of this network as aGraph
.private static <N,
E> NetworkConnections <N, E> connectionsOf
(Network<N, E> network, N node) static <N,
E> ImmutableNetwork <N, E> copyOf
(ImmutableNetwork<N, E> network) Deprecated.no need to use thisstatic <N,
E> ImmutableNetwork <N, E> Returns an immutable copy ofnetwork
.private static <N,
E> Map <E, N> getEdgeToReferenceNode
(Network<N, E> network) private static <N,
E> Map <N, NetworkConnections<N, E>> getNodeConnections
(Network<N, E> network) private static <N,
E> Function <E, N> sourceNodeFn
(Network<N, E> network) private static <N,
E> Function <E, N> targetNodeFn
(Network<N, E> network) Methods inherited from class com.google.common.graph.StandardNetwork
adjacentNodes, allowsParallelEdges, allowsSelfLoops, checkedConnections, checkedReferenceNode, containsEdge, containsNode, edgeOrder, edges, edgesConnecting, incidentEdges, incidentNodes, inEdges, isDirected, nodeOrder, nodes, outEdges, predecessors, successors
Methods inherited from class com.google.common.graph.AbstractNetwork
adjacentEdges, degree, edgeConnecting, edgeConnecting, edgeConnectingOrNull, edgeConnectingOrNull, edgeInvalidatableSet, edgesConnecting, equals, hasEdgeConnecting, hasEdgeConnecting, hashCode, inDegree, isOrderingCompatible, nodeInvalidatableSet, nodePairInvalidatableSet, outDegree, toString, validateEndpoints
-
Constructor Details
-
ImmutableNetwork
-
-
Method Details
-
copyOf
Returns an immutable copy ofnetwork
. -
copyOf
Deprecated.no need to use thisSimply returns its argument. -
asGraph
Description copied from interface:Network
Returns a live view of this network as aGraph
. The resultingGraph
will have an edge connecting node A to node B if thisNetwork
has an edge connecting A to B.If this network
allows parallel edges
, parallel edges will be treated as if collapsed into a single edge. For example, theNetwork.degree(Object)
of a node in theGraph
view may be less than the degree of the same node in thisNetwork
. -
getNodeConnections
-
getEdgeToReferenceNode
-
connectionsOf
-
sourceNodeFn
-
targetNodeFn
-
adjacentNodeFn
-