package areaidentification;

/**
 *
 * @author Ilias Foudalis
 */

public class Edge {
    
    short from,to;
    float weight;
    
    public Edge()
    {}
    
    public Edge(short from, short to)
    {
        this.from = from;
        this.to = to;        
    }
    
    public Edge(short from, short to, float weight)
    {
        this.from = from;
        this.to = to;        
        this.weight = weight;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 67 * hash + this.from;
        hash = 67 * hash + this.to;
        return hash;
    }
    
    @Override
    public boolean equals(Object o)
    {
        Edge e = (Edge)o;
        if(!(e instanceof Edge))
            return true;
        else if(e.from == this.from && e.to == this.to)
            return true;
        else if(e.from == this.to && e.to == this.from)
            return true;
        else return false;
    }
    
}

