org.jgrapht.generate
public class StarGraphGenerator<V,E> extends java.lang.Object implements GraphGenerator<V,E,V>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CENTER_VERTEX |
Constructor and Description |
---|
StarGraphGenerator(int order)
Creates a new StarGraphGenerator object.
|
Modifier and Type | Method and Description |
---|---|
void |
generateGraph(Graph<V,E> target,
VertexFactory<V> vertexFactory,
java.util.Map<java.lang.String,V> resultMap)
Generates a star graph with the designated order from the constructor
|
public static final java.lang.String CENTER_VERTEX
public StarGraphGenerator(int order)
order
- number of total vertices including the center vertexpublic 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)