Class MathTransformsOrFactory

java.lang.Object
org.apache.sis.internal.referencing.MathTransformsOrFactory
Direct Known Subclasses:
MathTransformsOrFactory.Specified

public class MathTransformsOrFactory extends Object
Proxy to MathTransforms method which can be redirected to a MathTransformFactory. The method signature in this class mirrors the one in MathTransforms. We do not provide this functionality as a MathTransformFactory implementation because we do not override all methods.
Since:
1.0
Version:
1.1
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static final class 
    A MathTransformsOrFactory implementation which delegate method calls to a MathTransformFactory specified by the user.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final MathTransformsOrFactory
    The unique instance to use when no MathTransformFactory is specified.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Do not allow instantiation of this class, except the inner sub-class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final org.opengis.referencing.operation.MathTransform
    concatenate(boolean applyOtherFirst, org.opengis.referencing.operation.MathTransform tr, org.opengis.referencing.operation.MathTransform other)
    Concatenates the two given transforms, switching their order if applyOtherFirst is true.
    org.opengis.referencing.operation.MathTransform
    concatenate(org.opengis.referencing.operation.MathTransform tr1, org.opengis.referencing.operation.MathTransform tr2)
    Concatenates the two given transforms.
    org.opengis.referencing.operation.MathTransform
    linear(org.opengis.referencing.operation.Matrix matrix)
    Creates an arbitrary linear transform from the specified matrix.
    org.opengis.referencing.operation.MathTransform
    passThrough(int firstAffectedCoordinate, org.opengis.referencing.operation.MathTransform subTransform, int numTrailingCoordinates)
    Creates a transform which passes through a subset of coordinates to another transform.
    wrap(org.opengis.referencing.operation.MathTransformFactory factory)
    Returns the instance to use for the given factory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INSTANCE

      private static final MathTransformsOrFactory INSTANCE
      The unique instance to use when no MathTransformFactory is specified.
  • Constructor Details

    • MathTransformsOrFactory

      private MathTransformsOrFactory()
      Do not allow instantiation of this class, except the inner sub-class.
  • Method Details

    • wrap

      public static MathTransformsOrFactory wrap(org.opengis.referencing.operation.MathTransformFactory factory)
      Returns the instance to use for the given factory.
      Parameters:
      factory - the factory, which may be null.
      Returns:
      the instance to use.
    • linear

      public org.opengis.referencing.operation.MathTransform linear(org.opengis.referencing.operation.Matrix matrix) throws org.opengis.util.FactoryException
      Creates an arbitrary linear transform from the specified matrix.
      Parameters:
      matrix - the matrix used to define the linear transform.
      Returns:
      the linear (usually affine) transform.
      Throws:
      org.opengis.util.FactoryException - if a factory is wrapped and cannot perform the operation.
    • passThrough

      public org.opengis.referencing.operation.MathTransform passThrough(int firstAffectedCoordinate, org.opengis.referencing.operation.MathTransform subTransform, int numTrailingCoordinates) throws org.opengis.util.FactoryException
      Creates a transform which passes through a subset of coordinates to another transform.
      Parameters:
      firstAffectedCoordinate - index of the first affected coordinate.
      subTransform - the sub-transform to apply on modified coordinates.
      numTrailingCoordinates - number of trailing coordinates to pass through.
      Returns:
      a pass-through transform, potentially as a PassThroughTransform instance but not necessarily.
      Throws:
      org.opengis.util.FactoryException - if a factory is wrapped and cannot perform the operation.
    • concatenate

      public org.opengis.referencing.operation.MathTransform concatenate(org.opengis.referencing.operation.MathTransform tr1, org.opengis.referencing.operation.MathTransform tr2) throws org.opengis.util.FactoryException
      Concatenates the two given transforms.
      Parameters:
      tr1 - the first math transform.
      tr2 - the second math transform.
      Returns:
      the concatenated transform.
      Throws:
      org.opengis.util.FactoryException - if a factory is wrapped and cannot perform the operation.
    • concatenate

      public final org.opengis.referencing.operation.MathTransform concatenate(boolean applyOtherFirst, org.opengis.referencing.operation.MathTransform tr, org.opengis.referencing.operation.MathTransform other) throws org.opengis.util.FactoryException
      Concatenates the two given transforms, switching their order if applyOtherFirst is true.
      Parameters:
      tr - the first math transform.
      other - the second math transform.
      applyOtherFirst - whether other should be first in the concatenation chain.
      Returns:
      the concatenated transform.
      Throws:
      org.opengis.util.FactoryException - if a factory is wrapped and cannot perform the operation.