# Class CoverageModifier.BandSource

Object
CoverageModifier.Source
BandSource

Enclosing interface:
  `CoverageModifier`

public static class CoverageModifier.BandSource extends CoverageModifier.Source
Information about which sample dimension (band) is subject to modification. Bands are identified by their index, starting at 0 and incremented sequentially.

Since:
  1.5

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BandSource(DataStore store, int coverageIndex, int bandIndex, int numBands, DataType dataType)`
  Creates a new source for the specified band.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getBandIndex()`
  Returns the index of the band for which to create sample dimension.
  `int`
  `getNumBands()`
  Returns the number of sample dimensions (bands) in the coverage.
  `Optional<NumberRange<?>>`
  `getSampleRange()`
  Return the minimum and maximum values declared in the coverage metadata, if known.

  ### Methods inherited from class CoverageModifier.Source

  `getCoverageIndex, getDataStore, getDataType, toString`

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### BandSource

    public BandSource(DataStore store, int coverageIndex, int bandIndex, int numBands, DataType dataType)
    Creates a new source for the specified band.
    Parameters:
      `store` - the data store which contains the band to modify.
      `coverageIndex` - index of the coverage for which to create a sample dimension.
      `bandIndex` - index of the band for which to create a sample dimension.
      `numBands` - number of bands.
      `dataType` - type of raster data, or `null` if unknown.

- ## Method Details

  - ### getBandIndex

    public int getBandIndex()
    Returns the index of the band for which to create sample dimension. The numbers start at 0.
    Returns:
      the index of the band for which to create sample dimension.

  - ### getNumBands

    public int getNumBands()
    Returns the number of sample dimensions (bands) in the coverage.
    Returns:
      the number of bands.

  - ### getSampleRange

    public Optional<NumberRange<?>> getSampleRange()
    Return the minimum and maximum values declared in the coverage metadata, if known. This range may contain the background value.
    Returns:
      the minimum and maximum values declared in the coverage.