//package Dasearch; public class coord implements Comparable { int y, x; int cost; // estimated cost, including heuristic int dist; // distance from source node coord prev; // pointer to previous coordinate on path. coord(int a, int b) {y=a; x=b;} public boolean equals(coord c) // two coords are same if x,y's are same { return (x==c.x && y==c.y); } public int compareTo(coord c) // compares cost { return c.cost - cost; // note: reverses relationship } } // coord