@Test public void getParentTest() { Tile rootTile = new Tile(0, 0, (byte) 0, TILE_SIZE); Assert.assertNull(rootTile.getParent()); Assert.assertEquals(rootTile, new Tile(0, 0, (byte) 1, TILE_SIZE).getParent()); Assert.assertEquals(rootTile, new Tile(1, 0, (byte) 1, TILE_SIZE).getParent()); Assert.assertEquals(rootTile, new Tile(0, 1, (byte) 1, TILE_SIZE).getParent()); Assert.assertEquals(rootTile, new Tile(1, 1, (byte) 1, TILE_SIZE).getParent()); }
public Tile getParent() { if (this.zoomLevel == 0) { return null; } return new Tile(this.tileX / 2, this.tileY / 2, (byte) (this.zoomLevel - 1), this.tileSize); }
Tile implements Serializable { public Tile getParent() { if (this.zoomLevel == 0) { return null; } return new Tile(this.tileX / 2, this.tileY / 2, (byte) (this.zoomLevel - 1), this.tileSize); } }
Tile implements Serializable { public Tile getParent() { if (this.zoomLevel == 0) { return null; } return new Tile(this.tileX / 2, this.tileY / 2, (byte) (this.zoomLevel - 1), this.tileSize); } Tile(int tileX, int tileY, byte zoomLevel, int tileSize); }
Tile implements Serializable { public Tile getParent() { if (this.zoomLevel == 0) { return null; } return new Tile(this.tileX / 2, this.tileY / 2, (byte) (this.zoomLevel - 1), this.tileSize); } 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 Tile getParent() { if (this.zoomLevel == 0) { return null; } return new Tile(this.tileX / 2, this.tileY / 2, (byte) (this.zoomLevel - 1), this.tileSize); } 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; }