org.geotoolkit.referencing.operation.transform
Class AbstractMathTransform.Inverse

Object
  extended by FormattableObject
      extended by AbstractMathTransform
          extended by AbstractMathTransform.Inverse
All Implemented Interfaces:
Serializable, Formattable, Parameterized, LenientComparable, MathTransform
Direct Known Subclasses:
AbstractMathTransform2D.Inverse
Enclosing class:
AbstractMathTransform

protected abstract class AbstractMathTransform.Inverse
extends AbstractMathTransform
implements Serializable

Default implementation for inverse math transform. This inner class is the inverse of the enclosing AbstractMathTransform. It is serializable only if the enclosing math transform is also serializable.

Since:
2.0
Version:
3.00
Author:
Martin Desruisseaux (IRD)
See Also:
Serialized Form
Module:
referencing/geotk-referencing (download)    View source code for this class

Nested Class Summary
 
Nested classes/interfaces inherited from class AbstractMathTransform
AbstractMathTransform.Inverse
 
Field Summary
 
Fields inherited from class FormattableObject
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE
 
Constructor Summary
protected AbstractMathTransform.Inverse()
          Constructs an inverse math transform.
 
Method Summary
protected  int computeHashCode()
          Computes a hash value for this transform.
 Matrix derivative(DirectPosition point)
          Gets the derivative of this transform at a point.
 Matrix derivative(Point2D point)
          Gets the derivative of this transform at a point.
 boolean equals(Object object, ComparisonMode mode)
          Compares the specified object with this inverse math transform for equality.
 String formatWKT(Formatter formatter)
          Formats the inner part of a Well Known Text (WKT) element.
 String getName()
          Returns a name for this math transform (never null).
 int getSourceDimensions()
          Gets the dimension of input points.
 int getTargetDimensions()
          Gets the dimension of output points.
 MathTransform inverse()
          Returns the inverse of this math transform, which is the enclosing math transform.
 boolean isIdentity()
          Tests whether this transform does not move any points.
 
Methods inherited from class AbstractMathTransform
createTransformedShape, ensureNonNull, equals, getParameterDescriptors, getParameterValues, hashCode, rollLongitude, transform, transform, transform, transform, transform, transform, transform
 
Methods inherited from class FormattableObject
getDefaultIndentation, print, setDefaultIndentation, toString, toWKT, toWKT, toWKT
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface MathTransform
toWKT
 

Constructor Detail

AbstractMathTransform.Inverse

protected AbstractMathTransform.Inverse()
Constructs an inverse math transform.

Method Detail

getName

public String getName()
Returns a name for this math transform (never null). The default implementation returns the direct transform name concatenated with localized flavor (when available) of "(Inverse transform)".

Overrides:
getName in class AbstractMathTransform
Returns:
A name for this math transform (never null).
Since:
2.5

getSourceDimensions

public int getSourceDimensions()
Gets the dimension of input points. The default implementation returns the dimension of output points of the enclosing math transform.

Specified by:
getSourceDimensions in interface MathTransform
Specified by:
getSourceDimensions in class AbstractMathTransform

getTargetDimensions

public int getTargetDimensions()
Gets the dimension of output points. The default implementation returns the dimension of input points of the enclosing math transform.

Specified by:
getTargetDimensions in interface MathTransform
Specified by:
getTargetDimensions in class AbstractMathTransform

derivative

public Matrix derivative(Point2D point)
                  throws TransformException
Gets the derivative of this transform at a point. The default implementation computes the inverse of the matrix returned by the enclosing math transform.

Overrides:
derivative in class AbstractMathTransform
Parameters:
point - The coordinate point where to evaluate the derivative.
Returns:
The derivative at the specified point as a 2×2 matrix.
Throws:
TransformException - if the derivative can't be evaluated at the specified point.
See Also:
MathTransform2D.derivative(Point2D)

derivative

public Matrix derivative(DirectPosition point)
                  throws TransformException
Gets the derivative of this transform at a point. The default implementation computes the inverse of the matrix returned by the enclosing math transform.

Specified by:
derivative in interface MathTransform
Overrides:
derivative in class AbstractMathTransform
Parameters:
point - The coordinate point where to evaluate the derivative.
Returns:
The derivative at the specified point (never null).
Throws:
TransformException - if the derivative can't be evaluated at the specified point.

inverse

public MathTransform inverse()
Returns the inverse of this math transform, which is the enclosing math transform. This behavior should not be changed since some implementation assume that the inverse of this is always AbstractMathTransform.this.

Specified by:
inverse in interface MathTransform
Overrides:
inverse in class AbstractMathTransform

isIdentity

public boolean isIdentity()
Tests whether this transform does not move any points. The default implementation delegates this tests to the enclosing math transform.

Specified by:
isIdentity in interface MathTransform
Overrides:
isIdentity in class AbstractMathTransform

computeHashCode

protected int computeHashCode()
Computes a hash value for this transform. This method is invoked by AbstractMathTransform.hashCode() when first needed.

Overrides:
computeHashCode in class AbstractMathTransform
Returns:
The hash code value. This value may change between different execution of the Geotk library.

equals

public boolean equals(Object object,
                      ComparisonMode mode)
Compares the specified object with this inverse math transform for equality. The default implementation tests if object in an instance of the same class than this, and if so compares their enclosing AbstractMathTransform.

Specified by:
equals in interface LenientComparable
Overrides:
equals in class AbstractMathTransform
Parameters:
object - The object to compare with this transform.
mode - The strictness level of the comparison. Default to STRICT.
Returns:
true if the given object is a transform of the same class and if, given identical source position, the transformed position would be the equals.

formatWKT

public String formatWKT(Formatter formatter)
Formats the inner part of a Well Known Text (WKT) element. If this inverse math transform has any parameter values, then this method format the WKT as in the super-class method. Otherwise this method format the math transform as an "INVERSE_MT" entity.

Specified by:
formatWKT in interface Formattable
Overrides:
formatWKT in class AbstractMathTransform
Parameters:
formatter - The formatter to use.
Returns:
The WKT element name, which is "PARAM_MT" or "INVERSE_MT" in the default implementation.
See Also:
FormattableObject.toWKT(), FormattableObject.toString()


Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.