Object
unless it is constrained by using a method like nodeOrder, or the builder is
constructed based on an existing ValueGraph using from(ValueGraph).
Object
unless the builder is constructed based on an existing Graph using from(ValueGraph).
MutableValueGraph or ImmutableValueGraph
with user-defined properties.
A ValueGraph built by this class has the following default properties:
ValueGraph#nodes() in the order in which the elements were added (insertion
order)
ValueGraphs built by this class also guarantee that each collection-returning accessor
returns a (live) unmodifiable view; see the external
documentation for details.
Examples of use:
// Building a mutable value graph
MutableValueGraph<String, Double> graph =
ValueGraphBuilder.undirected().allowsSelfLoops(true).build();
graph.putEdgeValue("San Francisco", "San Francisco", 0.0);
graph.putEdgeValue("San Jose", "San Jose", 0.0);
graph.putEdgeValue("San Francisco", "San Jose", 48.4);
// Building an immutable value graph
ImmutableValueGraph<String, Double> immutableGraph =
ValueGraphBuilder.undirected()
.allowsSelfLoops(true)
.<String, Double>immutable()
.putEdgeValue("San Francisco", "San Francisco", 0.0)
.putEdgeValue("San Jose", "San Jose", 0.0)
.putEdgeValue("San Francisco", "San Jose", 48.4)
.build();
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public ValueGraphBuilder | allowsSelfLoops(boolean allowsSelfLoops)
Specifies whether the graph will allow self-loops (edges that connect a node to itself). |
| public <N1 extends N, V1 extends V> MutableValueGraph | |
| private <N1 extends N, V1 extends V> ValueGraphBuilder | |
| pack-priv ValueGraphBuilder | |
| public static ValueGraphBuilder | |
| public ValueGraphBuilder | |
| public static <N, V> ValueGraphBuilder | from(ValueGraph<N, V> graph)
Returns a |
| public <N1 extends N, V1 extends V> ImmutableValueGraph. | |
| public <N1 extends N> ValueGraphBuilder | incidentEdgeOrder(ElementOrder<N1> incidentEdgeOrder)
Specifies the order of iteration for the elements of |
| public <N1 extends N> ValueGraphBuilder | nodeOrder(ElementOrder<N1> nodeOrder)
Specifies the order of iteration for the elements of |
| public static ValueGraphBuilder |
| ValueGraphBuilder | back to summary |
|---|---|
| private ValueGraphBuilder(boolean directed) Creates a new instance with the specified edge directionality. | |
| allowsSelfLoops | back to summary |
|---|---|
| public ValueGraphBuilder Specifies whether the graph will allow self-loops (edges that connect a node to itself).
Attempting to add a self-loop to a graph that does not allow them will throw an The default value is
| |
| build | back to summary |
|---|---|
| public <N1 extends N, V1 extends V> MutableValueGraph Returns an empty | |
| cast | back to summary |
|---|---|
private <N1 extends N, V1 extends V> ValueGraphBuilder
| |
| copy | back to summary |
|---|---|
| pack-priv ValueGraphBuilder | |
| directed | back to summary |
|---|---|
| public static ValueGraphBuilder Returns a | |
| expectedNodeCount | back to summary |
|---|---|
| public ValueGraphBuilder Specifies the expected number of nodes in the graph.
| |
| from | back to summary |
|---|---|
| public static <N, V> ValueGraphBuilder Returns a The "queryable" properties are those that are exposed through the | |
| immutable | back to summary |
|---|---|
| public <N1 extends N, V1 extends V> ImmutableValueGraph. Returns an The returned builder can be used for populating an Note that the returned builder will always have
| |
| incidentEdgeOrder | back to summary |
|---|---|
| public <N1 extends N> ValueGraphBuilder Specifies the order of iteration for the elements of The default value is
| |
| nodeOrder | back to summary |
|---|---|
| public <N1 extends N> ValueGraphBuilder Specifies the order of iteration for the elements of The default value is | |
| undirected | back to summary |
|---|---|
| public static ValueGraphBuilder Returns a | |