|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectOptLineGraphGenerator
OptDirectedLineGraphGenerator
public class OptDirectedLineGraphGenerator
An implementation of GraphGenerator used to generate an optimized graph
representing a line network. Graphs are generated by supplying the generator
with objects of type LineSegment via the add(Object) method.
For each line segment added, an edge in the graph is created. The builder
records the end coordinates of each line added, and maintains a map of
coordinates to nodes, creating nodes when neccessary.
Edges created by the generator are of type OptBasicEdge.
Nodes created by the generator are of type OptXYNode.
OptEdge
,
OptXYNode
Constructor Summary | |
---|---|
OptDirectedLineGraphGenerator()
Constructs a new OptLineGraphGenerator. |
Method Summary | |
---|---|
Graphable |
add(Object obj)
Adds a line to the graph. |
protected Edge |
generateEdge(LineSegment line)
|
protected void |
generateNodes()
|
Edge |
getEdge(Coordinate c1,
Coordinate c2)
Retrieve edge between the two coordinates. |
Map |
getInNodeMap()
Returns the coordinate to in node map. |
Node |
getNode(Coordinate c)
Look up a Node for the provided coordinate. |
Map |
getOutNodeMap()
Returns the coordinate to out node map. |
Methods inherited from class OptLineGraphGenerator |
---|
generate, generateEdges, get, getGraph, getGraphBuilder, getLines, getNodeMap, remove, setGraphBuilder |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OptDirectedLineGraphGenerator()
Method Detail |
---|
public Graphable add(Object obj)
add
in interface GraphGenerator
add
in class OptLineGraphGenerator
obj
- A LineSegment object.
public Map getInNodeMap()
public Map getOutNodeMap()
protected void generateNodes()
generateNodes
in class OptLineGraphGenerator
protected Edge generateEdge(LineSegment line)
generateEdge
in class OptLineGraphGenerator
public Node getNode(Coordinate c)
LineGraphGenerator
getNode
in interface LineGraphGenerator
getNode
in class OptLineGraphGenerator
public Edge getEdge(Coordinate c1, Coordinate c2)
LineGraphGenerator
getEdge
in interface LineGraphGenerator
getEdge
in class OptLineGraphGenerator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |