Sha256: b80519cf91ace899c25e6a0b0bf4fa8c08bf88b20fc4a97c94c89e2f6e1b5d88

Contents?: true

Size: 834 Bytes

Versions: 67

Compression:

Stored size: 834 Bytes

Contents

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

67 entries across 67 versions & 1 rubygems

Version Path
trackler-2.2.1.44 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.43 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.42 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.41 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.40 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.39 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.38 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.37 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.36 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.35 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.34 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.33 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.32 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.31 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.30 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.29 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.28 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.27 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.26 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java
trackler-2.2.1.25 tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java