/**********************************
 * Assignment 5: Pacman
 * Date: 5/5/2006
 *
 * Jenna Holloway: jh382, 563324
 * Benji Shultz: bas67, 1786511
 **********************************/
/**************************
 * The edge class
 */

package graph;

public class Edge implements Comparable<Edge> {
    int id;  // a unique non-negative identifier, assigned by the graph
    public Node v1, v2;  // the two end-points of the edge
    double weight;  // the weight of the edge

    /* Constructors
     */
    public Edge(int _id, Node _v1, Node _v2, double _weight) {
        id = _id;
        v1 = _v1;
        v2 = _v2;
        weight = _weight;
    }

    public int compareTo(Edge e){
        if (this.weight>e.weight) return 1;
        if (this.weight<e.weight) return -1;
        return 0;
      }
    /* Access methods
     */
    public int getId() {
        return id;
    }
    
    
    public double getWeight() {
        return weight;
    }
}
