public class OptLineGraphGenerator extends Object implements LineGraphGenerator
Constructor and Description |
---|
OptLineGraphGenerator()
Constructs a new OptLineGraphGenerator.
|
Modifier and Type | Method and Description |
---|---|
Graphable |
add(Object obj)
Adds a line to the graph.
|
void |
generate()
Performs the actual generation of the graph.
|
protected Edge |
generateEdge(LineSegment line) |
protected void |
generateEdges() |
protected void |
generateNodes() |
Graphable |
get(Object obj)
Returns the edge which represents a line.
|
Edge |
getEdge(Coordinate c1,
Coordinate c2)
Retrieve edge between the two coordinates.
|
Graph |
getGraph()
Returns the graph being generated.
|
GraphBuilder |
getGraphBuilder()
Returns the underlying builder.
|
protected List |
getLines()
Returns the lines added to the graph.
|
Node |
getNode(Coordinate c)
Look up a Node for the provided coordinate.
|
Map |
getNodeMap()
Returns the coordinate to node map.
|
Graphable |
remove(Object obj)
Unsupported operation.
|
void |
setGraphBuilder(GraphBuilder builder)
Sets the underlying builder used to physically construct the graph.
|
public OptLineGraphGenerator()
public Graphable add(Object obj)
add
in interface GraphGenerator
obj
- A LineSegment object.public Graphable get(Object obj)
get
in interface GraphGenerator
obj
- An instance of LineSegment.GraphGenerator.get(Object)
public Graphable remove(Object obj)
remove
in interface GraphGenerator
obj
- The object modelled by the component.UnsupportedOperationException
public void setGraphBuilder(GraphBuilder builder)
GraphGenerator
setGraphBuilder
in interface GraphGenerator
builder
- The new underlying GraphBuilder.GraphGenerator.setGraphBuilder(GraphBuilder)
public GraphBuilder getGraphBuilder()
GraphGenerator
getGraphBuilder
in interface GraphGenerator
GraphGenerator.getGraphBuilder()
public Graph getGraph()
GraphGenerator
getGraph
in interface GraphGenerator
GraphGenerator.getGraph()
public void generate()
public Map getNodeMap()
protected List getLines()
protected void generateNodes()
protected void generateEdges()
protected Edge generateEdge(LineSegment line)
public Node getNode(Coordinate c)
LineGraphGenerator
getNode
in interface LineGraphGenerator
public Edge getEdge(Coordinate c1, Coordinate c2)
LineGraphGenerator
getEdge
in interface LineGraphGenerator
Copyright © 1996–2019 Geotools. All rights reserved.