V - the graph vertex typeE - the graph edge typepublic class GridGraphGenerator<V,E> extends Object implements GraphGenerator<V,E,V>
| Modifier and Type | Field and Description | 
|---|---|
| static String | CORNER_VERTEXRole for the vertices at the corners. | 
| Constructor and Description | 
|---|
| GridGraphGenerator(int rows,
                  int cols)Creates a new GridGraphGenerator object with rows x cols dimension. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | generateGraph(Graph<V,E> target,
             VertexFactory<V> vertexFactory,
             Map<String,V> resultMap)Generate a graph structure. | 
public static final String CORNER_VERTEX
public GridGraphGenerator(int rows,
                          int cols)
rows - the number of rowscols - the number of columnspublic void generateGraph(Graph<V,E> target, VertexFactory<V> vertexFactory, Map<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)Copyright © 2017. All rights reserved.