# Class CoverageModifier.Source

Object
Source

Direct Known Subclasses:
  `CoverageModifier​.BandSource`

Enclosing interface:
  `CoverageModifier`

public static class CoverageModifier.Source extends Object
Information about which file and coverage (image) is subject to modification. Coverages are identified by their index, starting at 0 and incremented sequentially.

Since:
  1.5

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Source(DataStore store)`
  Creates a new source for the file as a whole.
  `Source(DataStore store, int coverageIndex, DataType dataType)`
  Creates a new source for a coverage at the specified index.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `OptionalInt`
  `getCoverageIndex()`
  Returns the index of the coverage for which to modify the description.
  `DataStore`
  `getDataStore()`
  Return the data store for which to modify a file, coverage (image) or sample dimension (band) description.
  `Optional<DataType>`
  `getDataType()`
  Returns the type in which the coverage (raster) data are stored.
  `String`
  `toString()`
  Returns a string representation for debugging purposes.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Source

    public Source(DataStore store)
    Creates a new source for the file as a whole. The coverage index and data type are unspecified.
    Parameters:
      `store` - the data store for which to modify some coverages or sample dimensions.

  - ### Source

    public Source(DataStore store, int coverageIndex, DataType dataType)
    Creates a new source for a coverage at the specified index.
    Parameters:
      `store` - the data store for which to modify some coverages or sample dimensions.
      `coverageIndex` - index of the coverage (image) for which to compute information.
      `dataType` - the type of raster data, or `null` if unknown.

- ## Method Details

  - ### getDataStore

    public DataStore getDataStore()
    Return the data store for which to modify a file, coverage (image) or sample dimension (band) description.
    Returns:
      the data store for which to modify a description.

  - ### getCoverageIndex

    public OptionalInt getCoverageIndex()
    Returns the index of the coverage for which to modify the description. If absent, then the modifications apply to the whole file.

    #### Interpretation in GeoTIFF files

    The index starts with 0 for the first (potentially pyramided) coverage and is incremented by 1 after each pyramid, as defined by the cloud Optimized GeoTIFF specification. Therefore, this index may differ from the TIFF Image File Directory (IFD) index.
    Returns:
      the index of the coverage to eventually modify.

  - ### getDataType

    public Optional<DataType> getDataType()
    Returns the type in which the coverage (raster) data are stored. The enumeration values are restricted to the types compatible with Java2D.
    Returns:
      the type of raster data.

  - ### toString

    public String toString()
    Returns a string representation for debugging purposes. The format or the returned string may change in any future version.
    Overrides:
      `toString` in class `Object`
    Returns:
      a string representation for debugging purposes.