org.geotools.graph.build.line
Class LineStringGraphGenerator
java.lang.Object
org.geotools.graph.build.line.BasicLineGraphGenerator
org.geotools.graph.build.line.LineStringGraphGenerator
- All Implemented Interfaces:
- GraphGenerator, LineGraphGenerator
- Direct Known Subclasses:
- DirectedLineStringGraphGenerator
- public class LineStringGraphGenerator
- extends BasicLineGraphGenerator
Builds a graph representing a line network in which edges in the network are
represented by LineString geometries. This implementation is a wrapper around
a LineGraphGenerator which sets underlying edge objects to be LineString
objects, and underlying Node objects to be Point objects. While generating
the graph, the generator uses the visited flag of created components to
determine when to create underying objects. For this reason it is not recomended
to modify the visited flag of any graph components.
- Author:
- Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
- See Also:
LineString
,
Point
Method Summary |
Graphable |
add(java.lang.Object obj)
Adds a line to the graph. |
Graphable |
get(java.lang.Object obj)
Returns the edge which represents a line. |
Graphable |
remove(java.lang.Object obj)
Removes the edge from the graph that represents a line. |
protected void |
setObject(Node n,
java.lang.Object obj)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LineStringGraphGenerator
public LineStringGraphGenerator()
add
public Graphable add(java.lang.Object obj)
- Description copied from class:
BasicLineGraphGenerator
- Adds a line to the graph.
- Specified by:
add
in interface GraphGenerator
- Overrides:
add
in class BasicLineGraphGenerator
- Parameters:
obj
- An instance of LineSegment.
- Returns:
- A BasicEdge.
- See Also:
LineSegment
,
GraphGenerator.add(Object)
remove
public Graphable remove(java.lang.Object obj)
- Description copied from class:
BasicLineGraphGenerator
- Removes the edge from the graph that represents a line.
- Specified by:
remove
in interface GraphGenerator
- Overrides:
remove
in class BasicLineGraphGenerator
- Returns:
- Edge that represents the line.
- See Also:
GraphGenerator.remove(Object)
get
public Graphable get(java.lang.Object obj)
- Description copied from class:
BasicLineGraphGenerator
- Returns the edge which represents a line. Note that if the exact same line
has been added to the graph multiple times, then only one of the edges that
represents it will be returned. It is undefined which edge will be returned.
- Specified by:
get
in interface GraphGenerator
- Overrides:
get
in class BasicLineGraphGenerator
- Parameters:
obj
- An instance of LineSegment.
- Returns:
- Edge that represents the line.
- See Also:
GraphGenerator.get(Object)
setObject
protected void setObject(Node n,
java.lang.Object obj)
- Overrides:
setObject
in class BasicLineGraphGenerator
Copyright © GeoTools. All Rights Reserved.