Class TileCachedGrid

All Implemented Interfaces:
Cloneable, ValueSource

public class TileCachedGrid extends Grid
The TileCachedGrid class is a Grid whose data is supplied from a TileSource and cached via the TileCacheManager.
Since:
3.3.1
Author:
Peter Hollemans
  • Constructor Details

    • TileCachedGrid

      public TileCachedGrid(Grid grid, TileSource source)
      Constructs a new grid from the specified tile source.
      Parameters:
      source - the tile source to use for tiles.
  • Method Details

    • getSource

      public TileSource getSource()
      Get the tile source used by this grid.
      Returns:
      the tile source.
      Since:
      3.5.0
    • getTilingScheme

      public TilingScheme getTilingScheme()
      Description copied from class: Grid
      Gets the tiling scheme for this grid if one is available.
      Overrides:
      getTilingScheme in class Grid
      Returns:
      the tiling scheme or null for none.
    • getDataClass

      public Class getDataClass()
      Description copied from class: DataVariable
      Gets the class associated with components of the data array.
      Overrides:
      getDataClass in class DataVariable
      Returns:
      the data class or null if the data array is null.
    • dispose

      public void dispose()
      Description copied from class: DataVariable
      Disposes of any resources used by this variable prior to being finalized. After calling this method, any calls to retrieve data values may generate errors.
      Overrides:
      dispose in class DataVariable
    • setValue

      public void setValue(int index, double val)
      Description copied from class: DataVariable
      Writes a scaled data value. The data value is scaled according to the scaling factor and offset and written to the data array.
      Overrides:
      setValue in class DataVariable
      Parameters:
      index - the index into the data array.
      val - the data value as a double. If the data value is Double.NaN and the missing value is non-null, the missing value is written to the array.
      See Also:
    • getValue

      public double getValue(int index)
      Description copied from class: DataVariable
      Reads a scaled data value. The data value is read from the data array and scaled according to the scaling factor and offset.
      Overrides:
      getValue in class DataVariable
      Parameters:
      index - the index into the data array.
      Returns:
      the scaled data value as a double. The Double.NaN value is used if the data value is missing.
      See Also:
    • getValue

      public double getValue(int row, int col)
      Description copied from class: Grid
      Reads a scaled data value with no navigation. The data value is read from the data array and scaled according to the scaling factor and offset. No navigation transform is applied to correct the data location.
      Overrides:
      getValue in class Grid
      Parameters:
      row - the data location row.
      col - the data location column.
      Returns:
      the scaled data value as a double. The Double.NaN value is used if the data value is missing or data coordinate is not valid.
      See Also:
    • getData

      public Object getData()
      Description copied from class: DataVariable
      Gets the variable data array. The returned data is read-only -- the result of attempting to set values in the data is undefined.
      Overrides:
      getData in class DataVariable
    • getData

      public Object getData(int[] start, int[] count)
      Description copied from class: Grid
      Gets a subset of grid data values. This method is similar to Grid.getData(int[], int[]), but retrieves only a subset of data values in the raw, unscaled form.
      Overrides:
      getData in class Grid
      Parameters:
      start - the subset starting [row, column].
      count - the subset dimension [rows, columns].
      Returns:
      an array containing the unscaled data values.
      See Also:
    • main

      public static void main(String[] argv) throws Exception
      Tests this class.
      Parameters:
      argv - the array of command line parameters.
      Throws:
      Exception