Package noaa.coastwatch.io.tile
Class TilingScheme.TilePosition
java.lang.Object
noaa.coastwatch.io.tile.TilingScheme.TilePosition
- All Implemented Interfaces:
Cloneable
- Enclosing class:
- TilingScheme
A tile position stores the row and column location coordinates of
a tile in a tiling scheme. The tile position is simply an int[2]
array wrapped in an object so that it may be used as a key in a
hash map.
-
Constructor Summary
ConstructorDescriptionTilePosition
(int row, int col) Creates a new tile position from tile coordinates. -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
contains
(int row, int col) Determines if a global coordinate is contained in the tile at this position.boolean
int[]
Gets the position coordinates.int[]
Gets the dimensions of the tile at this position.Gets the tiling scheme for this position.int[]
getStart()
Gets the starting global coordinates of the tile at this position.int
hashCode()
toString()
-
Constructor Details
-
TilePosition
public TilePosition(int row, int col) Creates a new tile position from tile coordinates.- Parameters:
row
- the tile row coordinate.col
- the tile column coordinate.- Throws:
IndexOutOfBoundsException
- if the coordinates do not reference a valid tile in the tiling scheme.
-
-
Method Details
-
toString
-
getCoords
public int[] getCoords()Gets the position coordinates. -
getDimensions
public int[] getDimensions()Gets the dimensions of the tile at this position.- Returns:
- the dimensions of the tile at this position as [rows, columns].
-
getStart
public int[] getStart()Gets the starting global coordinates of the tile at this position.- Returns:
- the starting global coordinates at this position as [rows, columns].
- Since:
- 3.3.1
-
hashCode
public int hashCode() -
contains
public boolean contains(int row, int col) Determines if a global coordinate is contained in the tile at this position.- Parameters:
row
- the global row coordinate.col
- the global column coordinate.- Returns:
- true if the location is in this tile position, or false if not.
-
equals
-
clone
-
getScheme
Gets the tiling scheme for this position.- Returns:
- the tiling scheme associated with this position.
-