Class TilingScheme.TilePosition

java.lang.Object
noaa.coastwatch.io.tile.TilingScheme.TilePosition
All Implemented Interfaces:
Cloneable
Enclosing class:
TilingScheme

public class TilingScheme.TilePosition extends Object implements Cloneable
A tile position stores the row and column location coordinates of a tile in a tiling scheme. The tile position is mainly an int[2] array wrapped in an object so that it may be used as a key in a hash map.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    TilePosition(int row, int col)
    Creates a new tile position from tile coordinates.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    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[]
    Gets the starting global coordinates of the tile at this position.
    int
     
     

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TilePosition

      protected 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

      public String toString()
      Overrides:
      toString in class Object
    • 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()
      Overrides:
      hashCode in class Object
    • 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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • getScheme

      public TilingScheme getScheme()
      Gets the tiling scheme for this position.
      Returns:
      the tiling scheme associated with this position.