N - Node parameter typeE - Edge parameter typepublic final class ImmutableNetwork<N,E> extends StandardNetwork<N,E>
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableNetwork.Builder<N,E>
A builder for creating
ImmutableNetwork instances, especially static final
networks. |
edgeToReferenceNode, nodeConnections| Modifier | Constructor and Description |
|---|---|
private |
ImmutableNetwork(Network<N,E> network) |
| Modifier and Type | Method and Description |
|---|---|
private static <N,E> Function<E,N> |
adjacentNodeFn(Network<N,E> network,
N node) |
ImmutableGraph<N> |
asGraph()
Returns a live view of this network as a
Graph. |
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 this
|
static <N,E> ImmutableNetwork<N,E> |
copyOf(Network<N,E> network)
Returns an immutable copy of
network. |
private static <N,E> java.util.Map<E,N> |
getEdgeToReferenceNode(Network<N,E> network) |
private static <N,E> java.util.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) |
adjacentNodes, allowsParallelEdges, allowsSelfLoops, checkedConnections, checkedReferenceNode, containsEdge, containsNode, edgeOrder, edges, edgesConnecting, incidentEdges, incidentNodes, inEdges, isDirected, nodeOrder, nodes, outEdges, predecessors, successorsadjacentEdges, degree, edgeConnecting, edgeConnecting, edgeConnectingOrNull, edgeConnectingOrNull, edgesConnecting, equals, hasEdgeConnecting, hasEdgeConnecting, hashCode, inDegree, isOrderingCompatible, outDegree, toString, validateEndpointspublic static <N,E> ImmutableNetwork<N,E> copyOf(Network<N,E> network)
network.@Deprecated public static <N,E> ImmutableNetwork<N,E> copyOf(ImmutableNetwork<N,E> network)
public ImmutableGraph<N> asGraph()
NetworkGraph. The resulting Graph will have
an edge connecting node A to node B if this Network 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, the Network.degree(Object) of a node
in the Graph view may be less than the degree of the same node in this Network.
private static <N,E> java.util.Map<N,NetworkConnections<N,E>> getNodeConnections(Network<N,E> network)
private static <N,E> java.util.Map<E,N> getEdgeToReferenceNode(Network<N,E> network)
private static <N,E> NetworkConnections<N,E> connectionsOf(Network<N,E> network, N node)