All Implemented Interfaces:
Direct Known Subclasses:
BasicDirectedGraphBuilder, BasicLineGraphBuilder, OptGraphBuilder
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
Author: Justin Deoliveira, Refractions Research Inc, firstname.lastname@example.org
Constructor and Description
Constructs a new empty graph builder.
Modifier and Type
Method and Description
( 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).
( addNode Node node)
Adds a node to the graph.
( buildEdge Node nodeA,
Builds a new edge for the graph.
Creates the underlying graph object.
Builds a new node for the graph.
(boolean deep) clone
Returns a clone of the builder.
Returns the edges belonging to the graph being built.
Returns the graph being built.
Returns the nodes belonging to the graph being built.
( importGraph Graph g)
Constructs a graph builder from a pre built graph.
( removeEdge Edge edge)
Removes an edge from the graph.
(java.util.Collection edges) removeEdges
Removes a collection of edges from the graph.
( removeNode Node node)
Removes an node from the graph.
(java.util.Collection nodes) removeNodes
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
Edge buildEdge( Node nodeA,
Builds a new edge for the graph. This method does not add the new node to
the graph, this must be done with the addEdge(Edge) method.
buildEdge GraphBuilder Parameters:
nodeA - Adjacent node to edge.
nodeB - Adjacent node to edge.
Returns: Edge the newly built Edge. See Also:
public java.lang.Object clone(boolean deep)
Returns a clone of the builder. A deep clone copies the underlying
graph structure, a non deep clone results in an empty builder
clone GraphBuilder Parameters:
deep - Deep or non deep clone.
Returns: A graph builder.
public void importGraph(
Constructs a graph builder from a pre built graph. The nodes and edges
of the existing graph are imported into the builder. Relationships between
nodes and edges are assummed to be preexistant.
importGraph GraphBuilder Parameters:
g - A pre built graph.
Copyright © 1996-2014 Geotools. All Rights Reserved.