Package org.apache.sis.referencing.operation

## Class DefaultPassThroughOperation

- Object
- - FormattableObject
  - - AbstractIdentifiedObject
    - - AbstractCoordinateOperation
      - - DefaultPassThroughOperation

- All Implemented Interfaces:
    `Serializable`, `Deprecable`, `LenientComparable`, `IdentifiedObject`, `CoordinateOperation`, `PassThroughOperation`, `SingleOperation`

      public class DefaultPassThroughOperation
      extends AbstractCoordinateOperation
      implements PassThroughOperation

  Specifies that a subset of a coordinate tuple is subject to a specific coordinate operation.
  Since:
    0.6
  See Also:
    Serialized Form

  Defined in the `sis-referencing` module

- - ### Field Summary

    - ### Fields inherited from class AbstractIdentifiedObject

      `DEPRECATED_KEY, LOCALE_KEY`

    - ### Fields inherited from interface CoordinateOperation

      `COORDINATE_OPERATION_ACCURACY_KEY, DOMAIN_OF_VALIDITY_KEY, OPERATION_VERSION_KEY, SCOPE_KEY`

    - ### Fields inherited from interface IdentifiedObject

      `ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `` | `DefaultPassThroughOperation​(Map<String,​?> properties, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, SingleOperation operation, int firstAffectedCoordinate, int numTrailingCoordinates)` | Constructs a single operation from a set of properties.
    `protected` | `DefaultPassThroughOperation​(PassThroughOperation operation)` | Creates a new coordinate operation with the same values than the specified one.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static DefaultPassThroughOperation` | `castOrCopy​(PassThroughOperation object)` | Returns a SIS coordinate operation implementation with the values of the given arbitrary implementation.
    `protected long` | `computeHashCode()` | Invoked by `hashCode()` for computing the hash code when first needed.
    `boolean` | `equals​(Object object, ComparisonMode mode)` | Compares this concatenated operation with the specified object for equality.
    `protected String` | `formatTo​(Formatter formatter)` | Formats this coordinate operation in a pseudo-Well Known Text (WKT) format.
    `Class<? extends PassThroughOperation>` | `getInterface()` | Returns the GeoAPI interface implemented by this class.
    `OperationMethod` | `getMethod()` | Deprecated. May be removed in GeoAPI 4.0 since it does not apply to pass-through operations.
    `int[]` | `getModifiedCoordinates()` | Returns the ordered sequence of indices in a source coordinate tuple of the coordinates affected by this pass-through operation.
    `SingleOperation` | `getOperation()` | Returns the operation to apply on the subset of a coordinate tuple.
    `ParameterValueGroup` | `getParameterValues()` | Deprecated. May be removed in GeoAPI 4.0 since it does not apply to pass-through operations.

    - ### Methods inherited from class AbstractCoordinateOperation

      `castOrCopy, getCoordinateOperationAccuracy, getDomainOfValidity, getInterpolationCRS, getLinearAccuracy, getMathTransform, getOperationVersion, getScope, getSourceCRS, getTargetCRS, getWrapAroundChanges, isDefiningConversion`

    - ### Methods inherited from class AbstractIdentifiedObject

      `castOrCopy, equals, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName`

    - ### Methods inherited from class FormattableObject

      `print, toString, toString, toWKT`

    - ### Methods inherited from class Object

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

    - ### Methods inherited from interface CoordinateOperation

      `getCoordinateOperationAccuracy, getDomainOfValidity, getMathTransform, getOperationVersion, getScope, getSourceCRS, getTargetCRS`

    - ### Methods inherited from interface IdentifiedObject

      `getAlias, getIdentifiers, getName, getRemarks, toWKT`

- - ### Constructor Detail

    - #### DefaultPassThroughOperation

          public DefaultPassThroughOperation​(Map<String,​?> properties,
                                             CoordinateReferenceSystem sourceCRS,
                                             CoordinateReferenceSystem targetCRS,
                                             SingleOperation operation,
                                             int firstAffectedCoordinate,
                                             int numTrailingCoordinates)

      Constructs a single operation from a set of properties. The properties given in argument follow the same rules than for the super-class constructor. The following table is a reminder of main (not all) properties:

      Recognized properties (non exhaustive list)
      Property name | Value type | Returned by
      --- | --- | ---
      "name" | `Identifier` or `String` | `AbstractIdentifiedObject.getName()`
      "identifiers" | `Identifier` (optionally as array) | `AbstractIdentifiedObject.getIdentifiers()`

      Parameters:
        `properties` - the properties to be given to the identified object.
        `sourceCRS` - the source CRS.
        `targetCRS` - the target CRS.
        `operation` - the operation to apply on the subset of a coordinate tuple.
        `firstAffectedCoordinate` - index of the first affected coordinate.
        `numTrailingCoordinates` - number of trailing coordinates to pass through.

    - #### DefaultPassThroughOperation

          protected DefaultPassThroughOperation​(PassThroughOperation operation)

      Creates a new coordinate operation with the same values than the specified one. This copy constructor provides a way to convert an arbitrary implementation into a SIS one or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API.

      This constructor performs a shallow copy, i.e. the properties are not cloned.

      Parameters:
        `operation` - the coordinate operation to copy.
      See Also:
        `castOrCopy(PassThroughOperation)`

  - ### Method Detail

    - #### castOrCopy

          public static DefaultPassThroughOperation castOrCopy​(PassThroughOperation object)

      Returns a SIS coordinate operation implementation with the values of the given arbitrary implementation. If the given object is already an instance of `DefaultPassThroughOperation`, then it is returned unchanged. Otherwise a new `DefaultPassThroughOperation` instance is created using the copy constructor and returned. Note that this is a shallow copy operation, since the other properties contained in the given object are not recursively copied.
      Parameters:
        `object` - the object to get as a SIS implementation, or `null` if none.
      Returns:
        a SIS implementation containing the values of the given object (may be the given object itself), or `null` if the argument was null.

    - #### getInterface

          public Class<? extends PassThroughOperation> getInterface()

      Returns the GeoAPI interface implemented by this class. The SIS implementation returns `PassThroughOperation​.class`.
      Note for implementers: Subclasses usually do not need to override this method since GeoAPI does not define `PassThroughOperation` sub-interface. Overriding possibility is left mostly for implementers who wish to extend GeoAPI with their own set of interfaces.
      Overrides:
        `getInterface` in class `AbstractCoordinateOperation`
      Returns:
        `PassThroughOperation​.class` or a user-defined sub-interface.

    - #### getMethod

          @Deprecated
          public OperationMethod getMethod()

      Deprecated.
      May be removed in GeoAPI 4.0 since it does not apply to pass-through operations.
      Specified by:
        `getMethod` in interface `SingleOperation`
      Returns:
        `null`.

    - #### getParameterValues

          @Deprecated
          public ParameterValueGroup getParameterValues()

      Deprecated.
      May be removed in GeoAPI 4.0 since it does not apply to pass-through operations.
      Specified by:
        `getParameterValues` in interface `SingleOperation`
      Returns:
        `null`.

    - #### getOperation

          public SingleOperation getOperation()

      Returns the operation to apply on the subset of a coordinate tuple.
      Upcoming API change
      This method is conformant to ISO 19111:2003. But the ISO 19111:2007 revision changed the type from `SingleOperation` to `CoordinateOperation`. This change may be applied in GeoAPI 4.0. This is necessary for supporting usage of `PassThroughOperation` with `ConcatenatedOperation`.
      Specified by:
        `getOperation` in interface `PassThroughOperation`
      Returns:
        the operation to apply on the subset of a coordinate tuple.
      See Also:
        `PassThroughTransform​.getSubTransform()`

    - #### getModifiedCoordinates

          public int[] getModifiedCoordinates()

      Returns the ordered sequence of indices in a source coordinate tuple of the coordinates affected by this pass-through operation.
      Specified by:
        `getModifiedCoordinates` in interface `PassThroughOperation`
      Returns:
        zero-based indices of the modified source coordinates.
      See Also:
        `PassThroughTransform​.getModifiedCoordinates()`

    - #### equals

          public boolean equals​(Object object,
                                ComparisonMode mode)

      Compares this concatenated operation with the specified object for equality. If the `mode` argument is `ComparisonMode​.STRICT` or `BY_CONTRACT`, then all available properties are compared including the domain of validity and the scope.
      Specified by:
        `equals` in interface `LenientComparable`
      Overrides:
        `equals` in class `AbstractCoordinateOperation`
      Parameters:
        `object` - the object to compare to `this`.
        `mode` - `STRICT` for performing a strict comparison, or `IGNORE_METADATA` for ignoring properties that do not make a difference in the numerical results of coordinate operations.
      Returns:
        `true` if both objects are equal for the given comparison mode.
      See Also:
        `AbstractIdentifiedObject​.computeHashCode()`, `Utilities​.deepEquals(Object, Object, ComparisonMode)`

    - #### computeHashCode

          protected long computeHashCode()

      Invoked by `hashCode()` for computing the hash code when first needed. See `AbstractIdentifiedObject​.computeHashCode()` for more information.
      Overrides:
        `computeHashCode` in class `AbstractCoordinateOperation`
      Returns:
        the hash code value. This value may change in any future Apache SIS version.

    - #### formatTo

          protected String formatTo​(Formatter formatter)

      Formats this coordinate operation in a pseudo-Well Known Text (WKT) format. Current format is specific to Apache SIS and may change in any future version if a standard format for pass through operations is defined.
      Overrides:
        `formatTo` in class `AbstractCoordinateOperation`
      Parameters:
        `formatter` - the formatter to use.
      Returns:
        currently `"PassThroughOperation"` (may change in any future version).
      Since:
        0.7
      See Also:
        WKT 2 specification §17