# Enum Class GridCoverageProcessor.Optimization

Object
Enum<GridCoverageProcessor.Optimization>
Optimization

All Implemented Interfaces:
  `Serializable`, `Comparable<GridCoverageProcessor​.Optimization>`, `Constable`

Enclosing class:
  `GridCoverageProcessor`

public static enum GridCoverageProcessor.Optimization extends Enum<GridCoverageProcessor.Optimization>
Types of changes that a coverage processor can do for executing an operation more efficiently. For example, the processor may, in some cases, replace an operation by a more efficient one. Those optimizations should not change significantly the sample values at any given location, but may change other aspects (in a compatible way) such as the `GridCoverage` subclass returned or the size of the underlying rendered images.

By default the `REPLACE_OPERATION` and `REPLACE_SOURCE` optimizations are enabled. Users may want to disable some optimizations for example in order to get more predictable results.

Since:
  1.3
See Also:
  - `GridCoverageProcessor​.getOptimizations()`
  - `GridCoverageProcessor​.setOptimizations(Set)`

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class Enum

  `Enum​.EnumDesc<E extends Enum<E>>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `REPLACE_OPERATION`
  Allows the replacement of an operation by a more efficient one.
  `REPLACE_SOURCE`
  Allows the replacement of source parameter by a more fundamental source.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static GridCoverageProcessor​.Optimization`
  `valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static GridCoverageProcessor​.Optimization[]`
  `values()`
  Returns an array containing the constants of this enum class, in the order they are declared.

  ### Methods inherited from class Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

  ### Methods inherited from class Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### REPLACE_OPERATION

    public static final GridCoverageProcessor.Optimization REPLACE_OPERATION
    Allows the replacement of an operation by a more efficient one. This optimization is enabled by default.

    #### Example

    If the `resample(…)` method is invoked with parameter values that cause the resampling to be a translation of the grid by an integer number of cells, then by default `GridCoverageProcessor` will use the `shiftGrid(…)` algorithm instead. This option can be cleared for forcing a full resampling operation in all cases.

  - ### REPLACE_SOURCE

    public static final GridCoverageProcessor.Optimization REPLACE_SOURCE
    Allows the replacement of source parameter by a more fundamental source. This replacement may change the results, but usually with better accuracy. This optimization is enabled by default.

    #### Example

    If the `resample(…)` method is invoked with a source grid coverage which is itself the result of a previous resampling, then instead of resampling an already resampled coverage, by default `GridCoverageProcessor` will resample the original coverage. This option can be cleared for disabling that replacement.

- ## Method Details

  - ### values

    public static GridCoverageProcessor.Optimization[] values()
    Returns an array containing the constants of this enum class, in the order they are declared.
    Returns:
      an array containing the constants of this enum class, in the order they are declared

  - ### valueOf

    public static GridCoverageProcessor.Optimization valueOf(String name)
    Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum class has no constant with the specified name
      `NullPointerException` - if the argument is null