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.voidsetGraphBuilder(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:GraphGeneratorAdds an object to the graph.- Specified by:
addin 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:GraphGeneratorRetrieves a component of the graph.- Specified by:
getin 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:GraphGeneratorRemoves an object from the graph.- Specified by:
removein 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:GraphGeneratorSets the underlying builder used to physically construct the graph.- Specified by:
setGraphBuilderin interfaceGraphGenerator- Parameters:
builder- The new underlying GraphBuilder.- See Also:
-
getGraphBuilder
Description copied from interface:GraphGeneratorReturns the underlying builder.- Specified by:
getGraphBuilderin interfaceGraphGenerator- Returns:
- The underyling builder.
- See Also:
-
getGraph
Description copied from interface:GraphGeneratorReturns the graph being generated.- Specified by:
getGraphin interfaceGraphGenerator- Returns:
- The generated graph.
- See Also:
-