Package com.jgalgo
Interface Graph.Builder
-
- Enclosing interface:
- Graph
public static interface Graph.Builder
A builder forGraph
objects.- Author:
- Barak Ugav
- See Also:
Graph.newBuilderDirected()
,Graph.newBuilderUndirected()
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Graph.Builder.Hint
Hints for a graph builder.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Graph.Builder
addHint(Graph.Builder.Hint hint)
Add a hint to this builder.Graph
build()
Create a new empty graph.Graph.Builder
expectedEdgesNum(int expectedEdgesNum)
Set the expected number of edges that will exist in the graph.Graph.Builder
expectedVerticesNum(int expectedVerticesNum)
Set the expected number of vertices that will exist in the graph.Graph.Builder
removeHint(Graph.Builder.Hint hint)
Remove a hint from this builder.Graph.Builder
setDirected(boolean directed)
Determine if graphs built by this builder should be directed or not.default BuilderType
setOption(String key, Object value)
[TL;DR Don't call me!] Set an option.
-
-
-
Method Detail
-
build
Graph build()
Create a new empty graph.- Returns:
- a new graph with the builder options
-
setDirected
Graph.Builder setDirected(boolean directed)
Determine if graphs built by this builder should be directed or not.- Parameters:
directed
- iftrue
, graphs built by this builder will be directed- Returns:
- this builder
-
expectedVerticesNum
Graph.Builder expectedVerticesNum(int expectedVerticesNum)
Set the expected number of vertices that will exist in the graph.- Parameters:
expectedVerticesNum
- the expected number of vertices in the graph- Returns:
- this builder
-
expectedEdgesNum
Graph.Builder expectedEdgesNum(int expectedEdgesNum)
Set the expected number of edges that will exist in the graph.- Parameters:
expectedEdgesNum
- the expected number of edges in the graph- Returns:
- this builder
-
addHint
Graph.Builder addHint(Graph.Builder.Hint hint)
Add a hint to this builder.Hints do not change the behavior of the graphs built by this builder, by may affect performance.
- Parameters:
hint
- the hint to add- Returns:
- this builder
-
removeHint
Graph.Builder removeHint(Graph.Builder.Hint hint)
Remove a hint from this builder.Hints do not change the behavior of the graphs built by this builder, by may affect performance.
- Parameters:
hint
- the hint to remove- Returns:
- this builder
-
setOption
default BuilderType setOption(String key, Object value)
[TL;DR Don't call me!] Set an option.The builder might support different options to customize its implementation. These options never change the behavior of the algorithm, only its internal implementation. The possible options are not exposed as 'public' because they are not part of the API and may change in the future.
These options are mainly for debug and benchmark purposes.
- Parameters:
key
- the option keyvalue
- the option value- Returns:
- this builder
-
-