public class EdgeGraph extends Object
HalfEdges. It supports tracking the vertices in the graph via edges incident on them, to allow efficient lookup of edges and vertices.
This class may be subclassed to use a different subclass of HalfEdge, by overriding createEdge(Coordinate). If additional logic is required to initialize edges then addEdge(Coordinate, Coordinate) can be overridden as well.
| Constructor and Description |
|---|
EdgeGraph()
|
| Modifier and Type | Method and Description |
|---|---|
HalfEdge |
addEdge(Coordinate
Adds an edge between the coordinates orig and dest to this graph.
|
protected HalfEdge |
createEdge(Coordinate
Creates a single HalfEdge.
|
HalfEdge |
findEdge(Coordinate
Finds an edge in this graph with the given origin and destination, if one exists.
|
Collection |
getVertexEdges()
|
static boolean |
isValidEdge(Coordinate
Tests if the given coordinates form a valid edge (with non-zero length).
|
protected HalfEdgecreateEdge(Coordinate orig)
orig - the origin location
public HalfEdgeaddEdge(Coordinate orig, Coordinate dest)
orig - the edge origin location
dest - the edge destination location.
#isValidEdge(Coordinate, Coordinate)}
public static boolean isValidEdge(Coordinateorig, Coordinate dest)
orig - the start coordinate
dest - the end coordinate
public CollectiongetVertexEdges()
public HalfEdgefindEdge(Coordinate orig, Coordinate dest)
orig - the origin location
dest - the destination location.