N
- Node parameter typeE
- Edge parameter type@Beta public final class ImmutableNetwork<N,E> extends ConfigurableNetwork<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.
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, successors
adjacentEdges, degree, inDegree, outDegree, toString
public 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()
Network
Graph
. 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)