package pacman;

/**
 * Created by IntelliJ IDEA.
 * User: Pany
 * Date: Aug 15, 2007
 * Time: 12:09:36 AM
 * To change this template use File | Settings | File Templates.
 */
public class Pair {

    int i,j;
    public Pair(int i, int j){
        this.i=i;
        this.j=j;
    }

    public void setI(int i){
        this.i=i;
    }
     public void setJ(int j){
        this.j=j;
    }
    public int getI(){
        return i;
    }
    public int getJ(){
        return j;
    }

    public void print(){
        System.out.println(i+" "+j);
    }

    public int compareTo(Pair p) {
	int thisI = this.i;
    int thisJ = this.j;
    int otherI = p.i;
    int otherJ = p.j;
	if(thisI<otherI)
        return -1;
    else if(thisI==otherI){
        if(thisJ<otherJ)
            return -1;
        else if(thisJ==otherJ)
            return 0;
        else
            return 1;
    }
    else
        return 1;
    }
}

