Graph whose elements and structural relationships will never change. Instances of this
class may be obtained with copyOf(Graph).
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 | ImmutableGraph.
A builder for creating |
| Modifier and Type | Field and Description |
|---|---|
| private final BaseGraph |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static <N> GraphConnections | |
| public static <N> ImmutableGraph | |
| public static <N> ImmutableGraph | |
| pack-priv BaseGraph | |
| private static <N> ImmutableMap | |
| public ElementOrder | incidentEdgeOrder()
Overrides com. Implements com. ElementOrder that specifies the order of iteration for the elements of
edges(), adjacentNodes(Object), predecessors(Object), successors(Object) and incidentEdges(Object).
|
| backingGraph | back to summary |
|---|---|
private final BaseGraph<N> backingGraph
| |
| ImmutableGraph | back to summary |
|---|---|
| pack-priv ImmutableGraph(BaseGraph<N> backingGraph) | |
| connectionsOf | back to summary |
|---|---|
private static <N> GraphConnections
| |
| copyOf | back to summary |
|---|---|
| public static <N> ImmutableGraph Returns an immutable copy of | |
| copyOf | back to summary |
|---|---|
| public static <N> ImmutableGraph Deprecated no need to use this Simply returns its argument.
| |
| delegate | back to summary |
|---|---|
| pack-priv BaseGraph Implements abstract com.
| |
| getNodeConnections | back to summary |
|---|---|
| private static <N> ImmutableMap | |
| incidentEdgeOrder | back to summary |
|---|---|
| public ElementOrder Overrides com. Implements com. Doc from com. Returns an
| |
ImmutableGraph instances, especially static final
graphs. Example:
static final ImmutableGraph<Country> COUNTRY_ADJACENCY_GRAPH =
GraphBuilder.undirected()
.<Country>immutable()
.putEdge(FRANCE, GERMANY)
.putEdge(FRANCE, BELGIUM)
.putEdge(GERMANY, BELGIUM)
.addNode(ICELAND)
.build();
Builder instances can be reused; it is safe to call build multiple times to build
multiple graphs in series. Each new graph contains all the elements of the ones created before
it.
| Modifier and Type | Field and Description |
|---|---|
| private final MutableGraph |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public ImmutableGraph. | |
| public ImmutableGraph | |
| public ImmutableGraph. | Returns: thisBuilder objectAdds an edge connecting |
| public ImmutableGraph. | Returns: thisBuilder objectAdds an edge connecting |
| mutableGraph | back to summary |
|---|---|
| private final MutableGraph<N> mutableGraph | |
| Builder | back to summary |
|---|---|
| pack-priv Builder(GraphBuilder<N> graphBuilder) | |
| addNode | back to summary |
|---|---|
| public ImmutableGraph. Adds Nodes must be unique, just as
| |
| build | back to summary |
|---|---|
| public ImmutableGraph Returns a newly-created | |
| putEdge | back to summary |
|---|---|
| public ImmutableGraph. Adds an edge connecting If the graph is directed, the resultant edge will be directed; otherwise, it will be undirected. If
| |
| putEdge | back to summary |
|---|---|
| public ImmutableGraph. Adds an edge connecting If this graph is directed, If this graph is directed, If either or both endpoints are not already present in this graph, this method will
silently
| |