package board; public class Position { int row; int col; public Position(int row, int col) { this.row = row; this.col = col; } public int getRow() { return row; } public int getCol() { return col; } public String toString() { return "[" + row + "," + col + "]"; } public int hashCode() { int result = 17; result = 37*result + row; result = 37*result + col; return result; } public boolean equals(Object other) { if (!(other instanceof Position)) return false; Position that = (Position) other; if (this.row != that.row) return false; return this.col == that.col; } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)