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

Object
  extended by Formattable
      extended by AbstractMathTransform
          extended by AbstractMathTransform.Inverse
All Implemented Interfaces:
Serializable, MathTransform
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 MathTransform. It is serializable only if the enclosing math transform is also serializable.

Since:
2.0
Author:
Martin Desruisseaux (IRD)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class AbstractMathTransform
AbstractMathTransform.Inverse
 
Field Summary
 
Fields inherited from class Formattable
SINGLE_LINE
 
Constructor Summary
protected AbstractMathTransform.Inverse()
          Constructs an inverse math transform.
 
Method Summary
 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)
          Compares the specified object with this inverse math transform for equality.
protected  String formatWKT(Formatter formatter)
          Format 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.
 int hashCode()
          Returns a hash code value for this math transform.
 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, getParameterDescriptors, getParameterValues, needCopy, rollLongitude, transform, transform, transform, transform, transform
 
Methods inherited from class Formattable
cleanupThreadLocals, toString, toWKT, toWKT, toWKT, toWKT
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface MathTransform
toWKT, transform
 

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
Returns:
The dimension of input points.

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
Returns:
The dimension of output points.

derivative

public Matrix derivative(Point2D point)
                  throws TransformException
Gets the derivative of this transform at a point. The default implementation compute 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 compute 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
Returns:
The inverse transform.

isIdentity

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

Specified by:
isIdentity in interface MathTransform
Overrides:
isIdentity in class AbstractMathTransform
Returns:
true if this MathTransform is an identity transform; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for this math transform.

Overrides:
hashCode in class AbstractMathTransform

equals

public boolean equals(Object object)
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 then test their enclosing math transforms.

Overrides:
equals in class AbstractMathTransform
Parameters:
object - The object to compare with this transform.
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

protected String formatWKT(Formatter formatter)
Format 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.

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:
Formattable.toWKT(), Formattable.toString()


Copyright © 1996-2014 Geotools. All Rights Reserved.