Package org.geotools.graph.build.basic
Class BasicGraphGenerator
Object
BasicGraphGenerator
- All Implemented Interfaces:
GraphGenerator
- Direct Known Subclasses:
BasicDirectedGraphGenerator
,FeatureGraphGenerator
An implementation of GraphGenerator. Graphs are generated as follows:
- Objects added to the generator are 2 element object arrays.
- The elements of the array represent the objects modelled by the nodes.
- The object array itself is the object modelled by the edges.
- As each object array is added to the generator:
- A node lookup table is queried using the elements of the object array.
- If a node lookup returns null, a new node is created for its respective object.
- A new edge is created incident to the two looked up nodes.
- The underlying object of the edge is set to the be object array.
- Author:
- Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds an object to the graph.Retrieves a component of the graph.getGraph()
Returns the graph being generated.Returns the underlying builder.Removes an object from the graph.void
setGraphBuilder
(GraphBuilder builder) Sets the underlying builder used to physically construct the graph.
-
Constructor Details
-
BasicGraphGenerator
public BasicGraphGenerator()Constructs a new generator.
-
-
Method Details
-
add
Description copied from interface:GraphGenerator
Adds an object to the graph.- Specified by:
add
in interfaceGraphGenerator
- Parameters:
obj
- The object to be modelled in the graph.- Returns:
- The graph component used to model the object.
- See Also:
-
get
Description copied from interface:GraphGenerator
Retrieves a component of the graph.- Specified by:
get
in interfaceGraphGenerator
- Parameters:
obj
- The object modelled by the component.- Returns:
- The graph component used to model the object.
- See Also:
-
remove
Description copied from interface:GraphGenerator
Removes an object from the graph.- Specified by:
remove
in interfaceGraphGenerator
- Parameters:
obj
- The object modelled by the component.- Returns:
- The graph component used to model the object.
- See Also:
-
setGraphBuilder
Description copied from interface:GraphGenerator
Sets the underlying builder used to physically construct the graph.- Specified by:
setGraphBuilder
in interfaceGraphGenerator
- Parameters:
builder
- The new underlying GraphBuilder.- See Also:
-
getGraphBuilder
Description copied from interface:GraphGenerator
Returns the underlying builder.- Specified by:
getGraphBuilder
in interfaceGraphGenerator
- Returns:
- The underyling builder.
- See Also:
-
getGraph
Description copied from interface:GraphGenerator
Returns the graph being generated.- Specified by:
getGraph
in interfaceGraphGenerator
- Returns:
- The generated graph.
- See Also:
-