public class Tile extends Object implements Comparable<Tile>, Cacheable
Level
. A collection of levels of progressive
resolutions are maintained in a LevelSet
. The Tile
class represents a single tile of a
subdivided image or elevation raster.
Individual tiles are identified by the level, row and column of the tile within its containing level set.Constructor and Description |
---|
Tile(Sector sector)
Constructs a texture tile for a given sector with a default level, row and column.
|
Tile(Sector sector,
Level level)
Constructs a texture tile for a given sector and level, and with a default row and column.
|
Tile(Sector sector,
Level level,
int row,
int column)
Constructs a tile for a given sector, level, row and column of the tile's containing tile set.
|
Tile(Sector sector,
Level level,
int row,
int column,
String cacheName)
Constructs a tile for a given sector, level, row and column of the tile's containing tile set.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Tile tile) |
static int |
computeColumn(Angle delta,
Angle longitude,
Angle origin)
Computes the column index of a longitude in the global tile grid corresponding to a specified grid interval.
|
static Angle |
computeColumnLongitude(int column,
Angle delta,
Angle origin)
Determines the minimum longitude of a column in the global tile grid corresponding to a specified grid interval.
|
static int |
computeRow(Angle delta,
Angle latitude,
Angle origin)
Computes the row index of a latitude in the global tile grid corresponding to a specified grid interval.
|
static Angle |
computeRowLatitude(int row,
Angle delta,
Angle origin)
Determines the minimum latitude of a row in the global tile grid corresponding to a specified grid interval.
|
boolean |
equals(Object o) |
String |
getCacheName()
Returns the tile's cache name.
|
int |
getColumn() |
String |
getFormatSuffix() |
int |
getHeight() |
String |
getLabel() |
Level |
getLevel() |
String |
getLevelName() |
int |
getLevelNumber() |
String |
getPath() |
String |
getPathBase() |
double |
getPriority() |
URL |
getResourceURL() |
URL |
getResourceURL(String imageFormat) |
int |
getRow() |
Sector |
getSector() |
long |
getSizeInBytes()
Retrieves the approximate size of this object in bytes.
|
TileKey |
getTileKey() |
int |
getWidth() |
int |
hashCode() |
void |
setPriority(double priority) |
String |
toString() |
public Tile(Sector sector)
sector
- the sector to create the tile for.public Tile(Sector sector, Level level)
sector
- the sector to create the tile for.level
- the level to associate the tile withIllegalArgumentException
- if sector or level are null.public Tile(Sector sector, Level level, int row, int column)
sector
- the sector corresponding with the tile.level
- the tile's level within a containing level set.row
- the row index (0 origin) of the tile within the indicated level.column
- the column index (0 origin) of the tile within the indicated level.IllegalArgumentException
- if sector
or level
is null.public Tile(Sector sector, Level level, int row, int column, String cacheName)
getCacheName()
. Otherwise, the
level's cache name is used.sector
- the sector corresponding with the tile.level
- the tile's level within a containing level set.row
- the row index (0 origin) of the tile within the indicated level.column
- the column index (0 origin) of the tile within the indicated level.cacheName
- optional cache name to override the Level's cache name. May be null.IllegalArgumentException
- if sector
or level
is null.public int compareTo(Tile tile)
compareTo
in interface Comparable<Tile>
public static int computeColumn(Angle delta, Angle longitude, Angle origin)
delta
- the grid intervallongitude
- the longitude for which to compute the column indexorigin
- the origin of the gridIllegalArgumentException
- if delta
is null or non-positive, or longitude
is
null, greater than positive 180 degrees, or less than negative 180 degreespublic static Angle computeColumnLongitude(int column, Angle delta, Angle origin)
column
- the row index of the row in questiondelta
- the grid intervalorigin
- the origin of the gridIllegalArgumentException
- if the grid interval (delta
) is null or zero or the column index is
negative.public static int computeRow(Angle delta, Angle latitude, Angle origin)
delta
- the grid intervallatitude
- the latitude for which to compute the row indexorigin
- the origin of the gridIllegalArgumentException
- if delta
is null or non-positive, or latitude
is null,
greater than positive 90 degrees, or less than negative 90 degreespublic static Angle computeRowLatitude(int row, Angle delta, Angle origin)
row
- the row index of the row in questiondelta
- the grid intervalorigin
- the origin of the gridIllegalArgumentException
- if the grid interval (delta
) is null or zero or the row index is
negative.public final String getCacheName()
public final int getColumn()
public final String getFormatSuffix()
public int getHeight()
public String getLabel()
public Level getLevel()
public final String getLevelName()
public final int getLevelNumber()
public String getPath()
public String getPathBase()
public double getPriority()
public URL getResourceURL() throws MalformedURLException
MalformedURLException
public URL getResourceURL(String imageFormat) throws MalformedURLException
MalformedURLException
public final int getRow()
public final Sector getSector()
public long getSizeInBytes()
Cacheable
getSizeInBytes
in interface Cacheable
Cacheable
object's size in bytespublic final TileKey getTileKey()
public int getWidth()
public void setPriority(double priority)