www.pudn.com > FindTheShortestPath-java.rar > Path.java
package shortestpath; /** *Title:
* *Description:
* *Copyright: Copyright (c) 2007
* *Company:
* * @author not attributable * @version 1.0 */ public class Path implements Comparable{ public Vertex dest; public double cost; public Path(Vertex dest,double dist) { this.dest=dest; this.cost=dist; } public int compareTo(Object rhs){ double otherCost=((Path)rhs).cost; return costotherCost?1:0; } }