|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.graph.build.LineGraphBuilder
Implentation of GraphBuilder that builds graphs from linear features.
In this type of graph, Features are represented by the edges, and relationships by the nodes. A feature is related to another feature when one of its enpoints is shared with one of the endpoints of another feature.
Constructor Summary | |
LineGraphBuilder()
Creates a new LineGraphBuilder object. |
Method Summary | |
GraphComponent |
add(org.geotools.feature.Feature feature)
Adds feature to the graph. |
protected void |
addEdge(Edge newEdge)
DOCUMENT ME! |
Graph |
build()
Signals the builder to complete the graph build. |
protected Edge |
buildEdge(org.geotools.feature.Feature feature,
Node n1,
Node n2)
DOCUMENT ME! |
protected Node |
buildNode(org.geotools.feature.Feature feature,
com.vividsolutions.jts.geom.Coordinate coordinate)
DOCUMENT ME! |
protected Node |
createNode(org.geotools.feature.Feature feature,
com.vividsolutions.jts.geom.Coordinate coordinate)
DOCUMENT ME! |
protected java.util.Collection |
getEdges()
DOCUMENT ME! |
Graph |
getGraph()
Returns the graph built by the builder. |
Node |
getNode(com.vividsolutions.jts.geom.Coordinate coord)
Returns a node that has been built at a specific coordinate. |
protected java.util.Map |
getNodes()
DOCUMENT ME! |
boolean |
isDirected()
Indicates wether or not the graph is directed. |
boolean |
isReversed()
Determines if the relationships in the graph are reversed. |
void |
removeEdge(Edge edge)
Removes an edge from the graph. |
void |
removeEdges(java.util.Collection edges)
Removes a collection of edges from the graph. |
void |
removeNode(Node node)
Removes a node from the graph. |
void |
setDirected(boolean directed)
Sets the graph to be directed/undirected. |
void |
setReversed(boolean reversed)
Sets the relationships in the graph to be reversed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LineGraphBuilder()
Method Detail |
public void setReversed(boolean reversed)
reversed
- True for reversed, false for normal.public boolean isReversed()
public void setDirected(boolean directed)
GraphBuilder
setDirected
in interface GraphBuilder
directed
- True if directed, false if undirected.GraphBuilder.setDirected(boolean)
public boolean isDirected()
GraphBuilder
isDirected
in interface GraphBuilder
GraphBuilder.isDirected()
public GraphComponent add(org.geotools.feature.Feature feature)
This is a custom implementaiton in which only the end points of the feature are considered (LineString geometry is required ).
add
in interface GraphBuilder
feature
- Feature with LineString geometry
GraphBuilder.add(Feature)
public void removeNode(Node node)
GraphBuilder
removeNode
in interface GraphBuilder
GraphBuilder.removeNode(Node)
public void removeEdge(Edge edge)
removeEdge
in interface GraphBuilder
edge
- DOCUMENT ME!public void removeEdges(java.util.Collection edges)
edges
- DOCUMENT ME!public Graph build()
GraphBuilder
build
in interface GraphBuilder
GraphBuilder.build()
public Graph getGraph()
GraphBuilder
getGraph
in interface GraphBuilder
GraphBuilder.getGraph()
public Node getNode(com.vividsolutions.jts.geom.Coordinate coord)
coord
- DOCUMENT ME!
protected void addEdge(Edge newEdge)
newEdge
- DOCUMENT ME!protected java.util.Map getNodes()
protected java.util.Collection getEdges()
protected Node createNode(org.geotools.feature.Feature feature, com.vividsolutions.jts.geom.Coordinate coordinate)
feature
- DOCUMENT ME!coordinate
- DOCUMENT ME!
protected Node buildNode(org.geotools.feature.Feature feature, com.vividsolutions.jts.geom.Coordinate coordinate)
feature
- DOCUMENT ME!coordinate
- DOCUMENT ME!
protected Edge buildEdge(org.geotools.feature.Feature feature, Node n1, Node n2)
feature
- DOCUMENT ME!n1
- DOCUMENT ME!n2
- DOCUMENT ME!
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |