|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.graph.build.RelationshipGraphBuilder
General purpose graph builder based on user defined relationships.
In this type of graph, the features are represented by the nodes, and the relationships by the edges. Relationships are defined using the FeatureRelator interface as a Stratagy object (GOF Stratagy pattern).
Constructor Summary | |
RelationshipGraphBuilder(FeatureRelator relator)
Creates a new RelationshipGraphBuilder object. |
|
RelationshipGraphBuilder(FeatureRelator relator,
com.vividsolutions.jts.index.SpatialIndex index)
Creates a new RelationshipGraphBuilder object. |
Method Summary | |
GraphComponent |
add(org.geotools.feature.Feature feature)
Adds a feature to the graph. |
protected void |
addEdge(Edge newEdge)
DOCUMENT ME! |
protected void |
addNode(Node newNode)
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)
DOCUMENT ME! |
protected java.util.Collection |
getEdges()
DOCUMENT ME! |
Graph |
getGraph()
Returns the graph built by the builder. |
protected java.util.Collection |
getNodes()
DOCUMENT ME! |
protected FeatureRelator |
getRelator()
DOCUMENT ME! |
boolean |
isDirected()
Indicates wether or not the graph is directed. |
protected void |
relate(Node n1,
Node n2)
DOCUMENT ME! |
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 |
removeNodes(java.util.Collection nodes)
Removes a collection of nodes from the graph. |
void |
setDirected(boolean directed)
Sets the graph to be directed/undirected. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RelationshipGraphBuilder(FeatureRelator relator, com.vividsolutions.jts.index.SpatialIndex index)
relator
- DOCUMENT ME!index
- DOCUMENT ME!public RelationshipGraphBuilder(FeatureRelator relator)
relator
- DOCUMENT ME!Method Detail |
public GraphComponent add(org.geotools.feature.Feature feature)
GraphBuilder
add
in interface GraphBuilder
feature
- Feature to be added. The feature will be encapsulated
with a GraphComponent
, either a Node
or a
Edge
. Which one is implentation dependant.
GraphBuilder.add(Feature)
public void removeNode(Node node)
GraphBuilder
removeNode
in interface GraphBuilder
GraphBuilder.removeNode(Node)
public void removeNodes(java.util.Collection nodes)
nodes
- DOCUMENT ME!public void removeEdge(Edge edge)
GraphBuilder
removeEdge
in interface GraphBuilder
edge
- GraphBuilder.removeEdge(Edge)
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 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()
protected java.util.Collection getNodes()
protected java.util.Collection getEdges()
protected FeatureRelator getRelator()
protected void relate(Node n1, Node n2)
n1
- DOCUMENT ME!n2
- DOCUMENT ME!protected Node buildNode(org.geotools.feature.Feature feature)
feature
- DOCUMENT ME!
protected void addNode(Node newNode)
newNode
- DOCUMENT ME!protected Edge buildEdge(org.geotools.feature.Feature feature, Node n1, Node n2)
feature
- DOCUMENT ME!n1
- DOCUMENT ME!n2
- DOCUMENT ME!
protected void addEdge(Edge newEdge)
newEdge
- DOCUMENT ME!
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |