//Implementation of position class //Mandatory assignment 1 //Course 02152 Concurrent Systems, DTU, Fall 2008 //Hans Henrik Løvengreen Sep 24, 2008 public class Pos { public int row; // Note: public public int col; public Pos(int i, int j) { row = i; col = j; } public static boolean equal(Pos p1, Pos p2) { if (p1 == null || p2 == null) return false; return (p1.row == p2.row) && (p1.col == p2.col); } public Pos copy() { return new Pos(row, col); } public boolean equals(Pos p) { return Pos.equal(this,p); } public String toString() { return "("+row+","+col+")"; } }