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