org.h2gis.network.graph_creator
Class GraphCreator<V extends org.javanetworkanalyzer.data.VId,E extends org.javanetworkanalyzer.model.Edge>

java.lang.Object
  extended by org.h2gis.network.graph_creator.GraphCreator<V,E>

public class GraphCreator<V extends org.javanetworkanalyzer.data.VId,E extends org.javanetworkanalyzer.model.Edge>
extends Object

Creates a JGraphT graph from an edges table produced by org.h2gis.h2spatialext.function.spatial.graph.ST_Graph. The graph has the vertex and edge classes passed to the constructor. Its global and edge orientations and weights are specified by the strings passed to the constructor.

Author:
Adam Gouge

Field Summary
static int DIRECTED_EDGE
           
static int REVERSED_EDGE
           
static int UNDIRECTED_EDGE
           
 
Constructor Summary
GraphCreator(Connection connection, String inputTable, GraphFunctionParser.Orientation globalOrientation, String edgeOrientationColumnName, String weightColumn, Class<? extends V> vertexClass, Class<? extends E> edgeClass)
          Constructor.
 
Method Summary
protected  org.javanetworkanalyzer.model.KeyedGraph<V,E> prepareGraph()
          Prepares a graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTED_EDGE

public static final int DIRECTED_EDGE
See Also:
Constant Field Values

REVERSED_EDGE

public static final int REVERSED_EDGE
See Also:
Constant Field Values

UNDIRECTED_EDGE

public static final int UNDIRECTED_EDGE
See Also:
Constant Field Values
Constructor Detail

GraphCreator

public GraphCreator(Connection connection,
                    String inputTable,
                    GraphFunctionParser.Orientation globalOrientation,
                    String edgeOrientationColumnName,
                    String weightColumn,
                    Class<? extends V> vertexClass,
                    Class<? extends E> edgeClass)
Constructor.

Parameters:
connection - Connection
inputTable - Name of edges table from org.h2gis.h2spatialext.function.spatial.graph.ST_Graph.
globalOrientation - Global orientation
edgeOrientationColumnName - Edge orientation
weightColumn - Weight column name
vertexClass - Vertex class
edgeClass - Edge class
Method Detail

prepareGraph

protected org.javanetworkanalyzer.model.KeyedGraph<V,E> prepareGraph()
                                                                                                                                                  throws SQLException
Prepares a graph.

Returns:
The newly prepared graph, or null if the graph could not be created
Throws:
SQLException


Copyright © 2015 IRSTV CNRS-FR-2488. All Rights Reserved.