|
|
@@ -1,31 +1,33 @@
|
|
1
|
|
-final class MatrixCoordinate {
|
|
2
|
|
-
|
|
3
|
|
- private final int row;
|
|
4
|
|
-
|
|
5
|
|
- private final int col;
|
|
6
|
|
-
|
|
7
|
|
- MatrixCoordinate(final int row, final int col) {
|
|
8
|
|
- this.row = row;
|
|
9
|
|
- this.col = col;
|
|
10
|
|
- }
|
|
11
|
|
-
|
|
12
|
|
- // Generated equals and hashcode.
|
|
13
|
|
-
|
|
14
|
|
- @Override
|
|
15
|
|
- public boolean equals(final Object o) {
|
|
16
|
|
- if (this == o) return true;
|
|
17
|
|
- if (o == null || getClass() != o.getClass()) return false;
|
|
18
|
|
-
|
|
19
|
|
- final MatrixCoordinate that = (MatrixCoordinate) o;
|
|
20
|
|
-
|
|
21
|
|
- return row == that.row && col == that.col;
|
|
22
|
|
- }
|
|
23
|
|
-
|
|
24
|
|
- @Override
|
|
25
|
|
- public int hashCode() {
|
|
26
|
|
- int result = row;
|
|
27
|
|
- result = 31 * result + col;
|
|
28
|
|
- return result;
|
|
29
|
|
- }
|
|
30
|
|
-
|
|
|
1
|
+class MatrixCoordinate {
|
|
|
2
|
+ private final int row;
|
|
|
3
|
+ private final int col;
|
|
|
4
|
+
|
|
|
5
|
+ MatrixCoordinate(final int row, final int col) {
|
|
|
6
|
+ this.row = row;
|
|
|
7
|
+ this.col = col;
|
|
|
8
|
+ }
|
|
|
9
|
+
|
|
|
10
|
+ @Override
|
|
|
11
|
+ public String toString() {
|
|
|
12
|
+ return "Row: " + row + ", Column: " + col;
|
|
|
13
|
+ }
|
|
|
14
|
+
|
|
|
15
|
+ // Generated equals and hashcode.
|
|
|
16
|
+
|
|
|
17
|
+ @Override
|
|
|
18
|
+ public boolean equals(final Object o) {
|
|
|
19
|
+ if (this == o) return true;
|
|
|
20
|
+ if (o == null || getClass() != o.getClass()) return false;
|
|
|
21
|
+
|
|
|
22
|
+ final MatrixCoordinate that = (MatrixCoordinate) o;
|
|
|
23
|
+
|
|
|
24
|
+ return row == that.row && col == that.col;
|
|
|
25
|
+ }
|
|
|
26
|
+
|
|
|
27
|
+ @Override
|
|
|
28
|
+ public int hashCode() {
|
|
|
29
|
+ int result = row;
|
|
|
30
|
+ result = 31 * result + col;
|
|
|
31
|
+ return result;
|
|
|
32
|
+ }
|
|
31
|
33
|
}
|