/** * Edge Class */ public class Edge { private Vertex start; private Vertex end; private int distance; /** * @param name * @param start * @param end * @param distance */ public Edge(Vertex start, Vertex end, int distance) { this.start = start; this.end = end; this.distance = distance; } /** * @return the start */ public Vertex getStart() { return start; } /** * @param start the start to set */ public void setStart(Vertex start) { this.start = start; } /** * @return the end */ public Vertex getEnd() { return end; } /** * @param end the end to set */ public void setEnd(Vertex end) { this.end = end; } /** * @return the distance */ public int getDistance() { return distance; } /** * @param distance the distance to set */ public void setDistance(int distance) { this.distance = distance; } /** * @param v the vertex not to return * @return the other vertex */ public Vertex getOtherVertex( Vertex v ) { if( v.equals( start ) ) return end; return start; } }