org.geotools.referencing.operation.transform
Class MathTransformProxy

Object
  extended by MathTransformProxy
All Implemented Interfaces:
Serializable, MathTransform
Direct Known Subclasses:
MathTransformProvider.Delegate

public class MathTransformProxy
extends Object
implements MathTransform, Serializable

A math transform which delegates part of its work to an other math transform. This is used as a starting point for subclass wanting to modifies only some aspect of an existing math transform, or to attach additional informations to it. The default implementation delegates all method calls to the underlying transform. Subclasses typically override some of those methods.

This class is serializable if the underlying transform is serializable too.

Since:
2.2
Author:
Martin Desruisseaux (IRD)
See Also:
Serialized Form
Module:
modules/library/referencing (gt-referencing.jar)

Field Summary
 MathTransform transform
          The math transform on which to delegate the work.
 
Constructor Summary
protected MathTransformProxy(MathTransform transform)
          Creates a new proxy which delegates its work to the specified math transform.
 
Method Summary
 Matrix derivative(DirectPosition 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.
 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.
 boolean isIdentity()
          Tests whether this transform does not move any points.
 String toString()
          Returns a string representation for this transform.
 String toWKT()
          Returns a Well Known Text (WKT) for this transform.
 DirectPosition transform(DirectPosition ptSrc, DirectPosition ptDst)
          Transforms the specified ptSrc and stores the result in ptDst.
 void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
          Transforms a list of coordinate point ordinal values.
 void transform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
          Transforms a list of coordinate point ordinal values.
 void transform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
          Transforms a list of coordinate point ordinal values.
 void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
          Transforms a list of coordinate point ordinal values.
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

transform

public final MathTransform transform
The math transform on which to delegate the work.

Constructor Detail

MathTransformProxy

protected MathTransformProxy(MathTransform transform)
Creates a new proxy which delegates its work to the specified math transform.

Parameters:
transform - The transform on which to delegate the work.
Method Detail

getSourceDimensions

public int getSourceDimensions()
Gets the dimension of input points.

Specified by:
getSourceDimensions in interface MathTransform

getTargetDimensions

public int getTargetDimensions()
Gets the dimension of output points.

Specified by:
getTargetDimensions in interface MathTransform

transform

public DirectPosition transform(DirectPosition ptSrc,
                                DirectPosition ptDst)
                         throws MismatchedDimensionException,
                                TransformException
Transforms the specified ptSrc and stores the result in ptDst.

Specified by:
transform in interface MathTransform
Throws:
MismatchedDimensionException - if ptSrc or ptDst doesn't have the expected dimension.
TransformException - if the point can't be transformed.

transform

public void transform(double[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
               throws TransformException
Transforms a list of coordinate point ordinal values.

Specified by:
transform in interface MathTransform
Throws:
TransformException

transform

public void transform(float[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
               throws TransformException
Transforms a list of coordinate point ordinal values.

Specified by:
transform in interface MathTransform
Throws:
TransformException

transform

public void transform(float[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
               throws TransformException
Transforms a list of coordinate point ordinal values.

Specified by:
transform in interface MathTransform
Throws:
TransformException

transform

public void transform(double[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
               throws TransformException
Transforms a list of coordinate point ordinal values.

Specified by:
transform in interface MathTransform
Throws:
TransformException

derivative

public Matrix derivative(DirectPosition point)
                  throws TransformException
Gets the derivative of this transform at a point.

Specified by:
derivative in interface MathTransform
Throws:
TransformException

inverse

public MathTransform inverse()
                      throws NoninvertibleTransformException
Returns the inverse of this math transform.

Specified by:
inverse in interface MathTransform
Throws:
NoninvertibleTransformException

isIdentity

public boolean isIdentity()
Tests whether this transform does not move any points.

Specified by:
isIdentity in interface MathTransform

toWKT

public String toWKT()
             throws UnsupportedOperationException
Returns a Well Known Text (WKT) for this transform.

Specified by:
toWKT in interface MathTransform
Throws:
UnsupportedOperationException - If this object can't be formatted as WKT.

toString

public String toString()
Returns a string representation for this transform.

Overrides:
toString in class Object

equals

public boolean equals(Object object)
Compares the specified object with this inverse math transform for equality.

Overrides:
equals in class Object
Parameters:
object - The object to compare with this transform.
Returns:
true if the given object is of the same class and if the wrapped transforms are equal.

hashCode

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

Overrides:
hashCode in class Object


Copyright © 1996-2010 Geotools. All Rights Reserved.