| 1234567891011121314151617181920212223242526272829303132333435363738 |
- class Pair {
-
- private final int x;
-
- private final int y;
-
- Pair(final int x, final int y) {
- this.y = y;
- this.x = x;
- }
-
- int getX() {
- return x;
- }
-
- int getY() {
- return y;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- Pair pair = (Pair) o;
-
- return x == pair.x && y == pair.y;
- }
-
- @Override
- public int hashCode() {
- int result = x;
- result = 31 * result + y;
- return result;
- }
-
- }
|