@Test public void getShiftYTest() { Tile tile0 = new Tile(0, 0, (byte) 0); Tile tile1 = new Tile(0, 1, (byte) 1); Tile tile2 = new Tile(1, 2, (byte) 2); Assert.assertEquals(0, tile0.getShiftY(tile0)); Assert.assertEquals(1, tile1.getShiftY(tile0)); Assert.assertEquals(2, tile2.getShiftY(tile0)); Assert.assertEquals(0, tile2.getShiftY(tile1)); }
public long getShiftY(Tile otherTile) { if (this.equals(otherTile)) { return 0; } return this.tileY % 2 + 2 * getParent().getShiftY(otherTile); }
Tile implements Serializable { public long getShiftY(Tile otherTile) { if (this.equals(otherTile)) { return 0; } return this.tileY % 2 + 2 * getParent().getShiftY(otherTile); } }
Tile implements Serializable { public long getShiftY(Tile otherTile) { if (this.equals(otherTile)) { return 0; } return this.tileY % 2 + 2 * getParent().getShiftY(otherTile); } Tile(long tileX, long tileY, byte zoomLevel); }
Tile implements Serializable { public long getShiftY(Tile otherTile) { if (this.equals(otherTile)) { return 0; } return this.tileY % 2 + 2 * getParent().getShiftY(otherTile); } 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 { public long getShiftY(Tile otherTile) { if (this.equals(otherTile)) { return 0; } return this.tileY % 2 + 2 * getParent().getShiftY(otherTile); } 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; }