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 |
|---|---|
| public static class | ImmutableNetwork.
A builder for creating |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static <N, E> Function | |
| public ImmutableGraph | asGraph()
Overrides com. Implements com. Graph.
|
| private static <N, E> NetworkConnections | |
| public static <N, E> ImmutableNetwork | |
| public static <N, E> ImmutableNetwork | |
| private static <N, E> Map | |
| private static <N, E> Map | |
| private static <N, E> Function | |
| private static <N, E> Function |
| ImmutableNetwork | back to summary |
|---|---|
| private ImmutableNetwork(Network<N, E> network) | |
| adjacentNodeFn | back to summary |
|---|---|
| private static <N, E> Function | |
| asGraph | back to summary |
|---|---|
| public ImmutableGraph Overrides com. Implements com. Doc from com. Returns a live view of this network as a If this network
| |
| connectionsOf | back to summary |
|---|---|
| private static <N, E> NetworkConnections | |
| copyOf | back to summary |
|---|---|
| public static <N, E> ImmutableNetwork Returns an immutable copy of | |
| copyOf | back to summary |
|---|---|
| public static <N, E> ImmutableNetwork Deprecated no need to use this Simply returns its argument.
| |
| getEdgeToReferenceNode | back to summary |
|---|---|
| private static <N, E> Map | |
| getNodeConnections | back to summary |
|---|---|
| private static <N, E> Map | |
| sourceNodeFn | back to summary |
|---|---|
| private static <N, E> Function | |
| targetNodeFn | back to summary |
|---|---|
| private static <N, E> Function | |
ImmutableNetwork instances, especially static final
networks. Example:
static final ImmutableNetwork<City, Train> TRAIN_NETWORK =
NetworkBuilder.undirected()
.allowsParallelEdges(true)
.<City, Train>immutable()
.addEdge(PARIS, BRUSSELS, Thalys.trainNumber("1111"))
.addEdge(PARIS, BRUSSELS, RegionalTrain.trainNumber("2222"))
.addEdge(LONDON, PARIS, Eurostar.trainNumber("3333"))
.addEdge(LONDON, BRUSSELS, Eurostar.trainNumber("4444"))
.addNode(REYKJAVIK)
.build();
Builder instances can be reused; it is safe to call build multiple times to build
multiple networks in series. Each new network contains all the elements of the ones created
before it.
| Modifier and Type | Field and Description |
|---|---|
| private final MutableNetwork |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public ImmutableNetwork. | |
| public ImmutableNetwork. | Returns: thisBuilder objectAdds |
| public ImmutableNetwork. | |
| public ImmutableNetwork |
| mutableNetwork | back to summary |
|---|---|
| private final MutableNetwork<N, E> mutableNetwork | |
| Builder | back to summary |
|---|---|
| pack-priv Builder(NetworkBuilder<N, E> networkBuilder) | |
| addEdge | back to summary |
|---|---|
| public ImmutableNetwork. Adds If the network is directed,
If If
| |
| addEdge | back to summary |
|---|---|
| public ImmutableNetwork. Adds If this network is directed, If this network is directed,
If either or both endpoints are not already present in this network, this method will
silently If
| |
| addNode | back to summary |
|---|---|
| public ImmutableNetwork. Adds Nodes must be unique, just as
| |
| build | back to summary |
|---|---|
| public ImmutableNetwork Returns a newly-created | |