Sha256: 343ecd39f629afe8dfdf0513aaa219c98be8491221e3c42326fee52469db9f2c

Contents?: true

Size: 840 Bytes

Versions: 309

Compression:

Stored size: 840 Bytes

Contents

final class GridPosition {

    final int x;

    final int y;

    GridPosition(final int x, final int y) {
        this.x = x;
        this.y = y;
    }

    /*
     * This equals method is of deliberately narrow scope (only allows comparison with another GridPosition) to increase
     * readability. In general, one should provide a full implementation of Object.equals(Object obj) and a
     * corresponding implementation of Object.hashCode(). See
     *
     * https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object)
     *
     * and
     *
     * https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#hashCode()
     *
     * for more information.
     */
    boolean equals(final GridPosition gridPosition) {
        return this.x == gridPosition.x && this.y == gridPosition.y;
    }

}

Version data entries

309 entries across 210 versions & 1 rubygems

Version Path
trackler-2.1.0.39 tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java
trackler-2.1.0.39 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.1.0.38 tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java
trackler-2.1.0.38 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.1.0.37 tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java
trackler-2.1.0.37 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.1.0.36 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.1.0.36 tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java
trackler-2.1.0.34 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.1.0.34 tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java
trackler-2.1.0.33 tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java
trackler-2.1.0.33 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.1.0.32 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.1.0.32 tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java
trackler-2.1.0.31 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.1.0.31 tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java
trackler-2.1.0.30 tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java
trackler-2.1.0.30 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.1.0.29 tracks/java/exercises/robot-simulator/src/example/java/GridPosition.java
trackler-2.1.0.29 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java