

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object org.geotools.graph.build.basic.BasicGraphBuilder
Basic implementation of GraphBuilder. This implementation of builder creates the graph when the builder is created. The underlying graph implementation makes copies of the references to the node and edge collections, not copies of the underlying collections themselves. In this way as nodes and edges are added to the builder, it is reflected in the built graph.
Constructor Summary  
BasicGraphBuilder()
Constructs a new empty graph builder. 
Method Summary  
void 
addEdge(Edge edge)
Checks for loops in which case it only added the edge to the adjacency list of one of the nodes (both of its nodes are the same node). 
void 
addNode(Node node)
Adds a node to the graph. 
Edge 
buildEdge(Node nodeA,
Node nodeB)
Builds a new edge for the graph. 
protected Graph 
buildGraph()
Creates the underlying graph object. 
Node 
buildNode()
Builds a new node for the graph. 
java.lang.Object 
clone(boolean deep)
Returns a clone of the builder. 
java.util.Collection 
getEdges()
Returns the edges belonging to the graph being built. 
Graph 
getGraph()
Returns the graph being built. 
java.util.Collection 
getNodes()
Returns the nodes belonging to the graph being built. 
void 
importGraph(Graph g)
Constructs a graph builder from a pre built graph. 
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 an node from the graph. 
void 
removeNodes(java.util.Collection nodes)
Removes a collection of nodes from the graph. 
Methods inherited from class java.lang.Object 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 
public BasicGraphBuilder()
Method Detail 
public Node buildNode()
GraphBuilder
buildNode
in interface GraphBuilder
GraphBuilder.buildNode()
public Edge buildEdge(Node nodeA, Node nodeB)
GraphBuilder
buildEdge
in interface GraphBuilder
nodeA
 Adjacent node to edge.nodeB
 Adjacent node to edge.
GraphBuilder.buildEdge(Node, Node)
public void addNode(Node node)
GraphBuilder
addNode
in interface GraphBuilder
node
 Node to be added to graph.GraphBuilder.addNode(Node)
public void addEdge(Edge edge)
addEdge
in interface GraphBuilder
edge
 Edge to be added to graph.GraphBuilder.addEdge(Edge)
public void removeNode(Node node)
GraphBuilder
removeNode
in interface GraphBuilder
node
 Node to be removed from graph.GraphBuilder.removeNode(Node)
public void removeNodes(java.util.Collection nodes)
GraphBuilder
removeNodes
in interface GraphBuilder
nodes
 A collection of nodes to be removed from the graph.GraphBuilder.removeNodes(Collection)
public void removeEdge(Edge edge)
GraphBuilder
removeEdge
in interface GraphBuilder
edge
 Edge to be removed from graph.GraphBuilder.removeEdge(Edge)
public void removeEdges(java.util.Collection edges)
GraphBuilder
removeEdges
in interface GraphBuilder
edges
 Collection of edges to be removed from the graph.GraphBuilder.removeEdges(Collection)
public Graph getGraph()
GraphBuilder
getGraph
in interface GraphBuilder
GraphBuilder.getGraph()
public java.lang.Object clone(boolean deep) throws java.lang.Exception
GraphBuilder
clone
in interface GraphBuilder
deep
 Deep or non deep clone.
java.lang.Exception
GraphBuilder.clone(boolean)
public void importGraph(Graph g)
GraphBuilder
importGraph
in interface GraphBuilder
GraphBuilder.importGraph(Graph)
public java.util.Collection getNodes()
public java.util.Collection getEdges()
protected Graph buildGraph()


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 