@Test public void equalsTest() { Tile tile1 = new Tile(1, 2, (byte) 3); Tile tile2 = new Tile(1, 2, (byte) 3); Tile tile3 = new Tile(1, 1, (byte) 3); Tile tile4 = new Tile(2, 2, (byte) 3); Tile tile5 = new Tile(1, 2, (byte) 4); TestUtils.equalsTest(tile1, tile2); TestUtils.notEqualsTest(tile1, tile3); TestUtils.notEqualsTest(tile1, tile4); TestUtils.notEqualsTest(tile1, tile5); TestUtils.notEqualsTest(tile1, new Object()); TestUtils.notEqualsTest(tile1, null); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (!(obj instanceof Tile)) { return false; } Tile other = (Tile) obj; if (this.tileX != other.tileX) { return false; } else if (this.tileY != other.tileY) { return false; } else if (this.zoomLevel != other.zoomLevel) { return false; } return true; }
Tile implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (!(obj instanceof Tile)) { return false; } Tile other = (Tile) obj; if (this.tileX != other.tileX) { return false; } else if (this.tileY != other.tileY) { return false; } else if (this.zoomLevel != other.zoomLevel) { return false; } return true; } }
Tile implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (!(obj instanceof Tile)) { return false; } Tile other = (Tile) obj; if (this.tileX != other.tileX) { return false; } else if (this.tileY != other.tileY) { return false; } else if (this.zoomLevel != other.zoomLevel) { return false; } return true; } Tile(long tileX, long tileY, byte zoomLevel); }
Tile implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (!(obj instanceof Tile)) { return false; } Tile other = (Tile) obj; if (this.tileX != other.tileX) { return false; } else if (this.tileY != other.tileY) { return false; } else if (this.zoomLevel != other.zoomLevel) { return false; } return true; } Tile(long tileX, long tileY, byte zoomLevel); static long getMaxTileNumber(byte zoomLevel); @Override boolean equals(Object obj); Tile getParent(); long getShiftX(Tile otherTile); long getShiftY(Tile otherTile); @Override int hashCode(); @Override String toString(); }
Tile implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (!(obj instanceof Tile)) { return false; } Tile other = (Tile) obj; if (this.tileX != other.tileX) { return false; } else if (this.tileY != other.tileY) { return false; } else if (this.zoomLevel != other.zoomLevel) { return false; } return true; } Tile(long tileX, long tileY, byte zoomLevel); static long getMaxTileNumber(byte zoomLevel); @Override boolean equals(Object obj); Tile getParent(); long getShiftX(Tile otherTile); long getShiftY(Tile otherTile); @Override int hashCode(); @Override String toString(); final long tileX; final long tileY; final byte zoomLevel; }