Interface Edge
-
public interface EdgeRepresents an edge (or direct route between two points) for theDijkstraAlgorithm. Implement this class to hold the start and end vertex for an edge and implement thegetPenalty()method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description VertexgetEnd()Returns the end vertex of the edge.intgetPenalty()Returns the penalty (or distance) for this edge.VertexgetStart()Returns the start vertex of the edge.
-
-
-
Method Detail
-
getStart
Vertex getStart()
Returns the start vertex of the edge.- Returns:
- the start vertex
-
getEnd
Vertex getEnd()
Returns the end vertex of the edge.- Returns:
- the end vertex
-
getPenalty
int getPenalty()
Returns the penalty (or distance) for this edge.- Returns:
- the penalty value (must be non-negative)
-
-