@Test public void getShiftXTest() { Tile tile0 = new Tile(0, 0, (byte) 0, TILE_SIZE); Tile tile1 = new Tile(0, 1, (byte) 1, TILE_SIZE); Tile tile2 = new Tile(1, 2, (byte) 2, TILE_SIZE); Assert.assertEquals(0, tile0.getShiftX(tile0)); Assert.assertEquals(0, tile1.getShiftX(tile0)); Assert.assertEquals(1, tile2.getShiftX(tile0)); Assert.assertEquals(1, tile2.getShiftX(tile1)); }
public int getShiftX(Tile otherTile) { if (this.equals(otherTile)) { return 0; } return this.tileX % 2 + 2 * getParent().getShiftX(otherTile); }
Tile implements Serializable { public int getShiftX(Tile otherTile) { if (this.equals(otherTile)) { return 0; } return this.tileX % 2 + 2 * getParent().getShiftX(otherTile); } }
Tile implements Serializable { public int getShiftX(Tile otherTile) { if (this.equals(otherTile)) { return 0; } return this.tileX % 2 + 2 * getParent().getShiftX(otherTile); } Tile(int tileX, int tileY, byte zoomLevel, int tileSize); }
Tile implements Serializable { public int getShiftX(Tile otherTile) { if (this.equals(otherTile)) { return 0; } return this.tileX % 2 + 2 * getParent().getShiftX(otherTile); } Tile(int tileX, int tileY, byte zoomLevel, int tileSize); static BoundingBox getBoundingBox(Tile upperLeft, Tile lowerRight); static Rectangle getBoundaryAbsolute(Tile upperLeft, Tile lowerRight); static boolean tileAreasOverlap(Tile upperLeft, Tile lowerRight, Tile upperLeftOther, Tile lowerRightOther); static int getMaxTileNumber(byte zoomLevel); @Override boolean equals(Object obj); BoundingBox getBoundingBox(); Set<Tile> getNeighbours(); Rectangle getBoundaryAbsolute(); Rectangle getBoundaryRelative(); Point getOrigin(); Tile getLeft(); Tile getRight(); Tile getAbove(); Tile getBelow(); Tile getAboveLeft(); Tile getAboveRight(); Tile getBelowLeft(); Tile getBelowRight(); Tile getParent(); int getShiftX(Tile otherTile); int getShiftY(Tile otherTile); @Override int hashCode(); @Override String toString(); }
Tile implements Serializable { public int getShiftX(Tile otherTile) { if (this.equals(otherTile)) { return 0; } return this.tileX % 2 + 2 * getParent().getShiftX(otherTile); } Tile(int tileX, int tileY, byte zoomLevel, int tileSize); static BoundingBox getBoundingBox(Tile upperLeft, Tile lowerRight); static Rectangle getBoundaryAbsolute(Tile upperLeft, Tile lowerRight); static boolean tileAreasOverlap(Tile upperLeft, Tile lowerRight, Tile upperLeftOther, Tile lowerRightOther); static int getMaxTileNumber(byte zoomLevel); @Override boolean equals(Object obj); BoundingBox getBoundingBox(); Set<Tile> getNeighbours(); Rectangle getBoundaryAbsolute(); Rectangle getBoundaryRelative(); Point getOrigin(); Tile getLeft(); Tile getRight(); Tile getAbove(); Tile getBelow(); Tile getAboveLeft(); Tile getAboveRight(); Tile getBelowLeft(); Tile getBelowRight(); Tile getParent(); int getShiftX(Tile otherTile); int getShiftY(Tile otherTile); @Override int hashCode(); @Override String toString(); final long mapSize; final int tileSize; final int tileX; final int tileY; final byte zoomLevel; }