org.jgrapht.generate
public class LinearGraphGenerator<V,E> extends java.lang.Object implements GraphGenerator<V,E,V>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
END_VERTEX
Role for the last vertex generated.
|
static java.lang.String |
START_VERTEX
Role for the first vertex generated.
|
| Constructor and Description |
|---|
LinearGraphGenerator(int size)
Construct a new LinearGraphGenerator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
generateGraph(Graph<V,E> target,
VertexFactory<V> vertexFactory,
java.util.Map<java.lang.String,V> resultMap)
Generate a graph structure.
|
public static final java.lang.String START_VERTEX
public static final java.lang.String END_VERTEX
public LinearGraphGenerator(int size)
size - number of vertices to be generatedjava.lang.IllegalArgumentException - if the specified size is negative.public void generateGraph(Graph<V,E> target, VertexFactory<V> vertexFactory, java.util.Map<java.lang.String,V> resultMap)
generateGraph in interface GraphGenerator<V,E,V>target - receives the generated edges and vertices; if this is
non-empty on entry, the result will be a disconnected graph since
generated elements will not be connected to existing elementsvertexFactory - called to produce new verticesresultMap - if non-null, receives implementation-specific mappings
from String roles to graph elements (or collections of graph elements)