org.geotools.graph.build
Interface GraphBuilder

All Known Implementing Classes:
LineGraphBuilder, RelationshipGraphBuilder

public interface GraphBuilder

Interface for building graph components. Graphs are built by continously supplying features to the builder, see FeatureReader


Method Summary
 GraphComponent add(org.geotools.feature.Feature feature)
          Adds a feature to the graph.
 Graph build()
          Signals the builder to complete the graph build.
 Graph getGraph()
          Returns the graph built by the builder.
 boolean isDirected()
          Indicates wether or not the graph is directed.
 void removeEdge(Edge edge)
          Removes an edge from the graph.
 void removeNode(Node node)
          Removes a node from the graph.
 void setDirected(boolean directed)
          Sets the graph to be directed/undirected.
 

Method Detail

add

public GraphComponent add(org.geotools.feature.Feature feature)
Adds a feature to the graph.

Parameters:
feature - Feature to be added. The feature will be encapsulated with a GraphComponent, either a Node or a Edge. Which one is implentation dependant.
Returns:
The graph component that encapsulates the added feature.

removeNode

public void removeNode(Node node)
Removes a node from the graph.


removeEdge

public void removeEdge(Edge edge)
Removes an edge from the graph.

Parameters:
edge -

build

public Graph build()
Signals the builder to complete the graph build.

Returns:
The built Graph object.

getGraph

public Graph getGraph()
Returns the graph built by the builder.

Returns:
Graph
See Also:
Graph

setDirected

public void setDirected(boolean directed)
Sets the graph to be directed/undirected.

Parameters:
directed - True if directed, false if undirected.

isDirected

public boolean isDirected()
Indicates wether or not the graph is directed.

Returns:
True if directed, false if undirected.