org.geotools.referencing.piecewise
Class DefaultPiecewiseTransform1DElement

Object
  extended by DefaultDomainElement1D
      extended by DefaultPiecewiseTransform1DElement
All Implemented Interfaces:
Serializable, Comparable<DomainElement1D>, DomainElement1D, PiecewiseTransform1DElement, MathTransform, MathTransform1D
Direct Known Subclasses:
DefaultLinearPiecewiseTransform1DElement

public class DefaultPiecewiseTransform1DElement
extends DefaultDomainElement1D
implements PiecewiseTransform1DElement

Convenience implementation of the DefaultPiecewiseTransform1DElement .

Author:
Simone Giannecchini, GeoSolutions
See Also:
Serialized Form

Constructor Summary
protected DefaultPiecewiseTransform1DElement(CharSequence name, NumberRange<? extends Number> valueRange)
          Protected constructor for DomainElement1Ds that want to build their transform later on.
protected DefaultPiecewiseTransform1DElement(CharSequence name, NumberRange<? extends Number> valueRange, MathTransform1D transform)
          Public constructor for building a DomainElement1D which applies the specified transformation on the values that fall into its definition range.
 
Method Summary
static DefaultPiecewiseTransform1DElement create(CharSequence name)
          Creates a pass-through DefaultPiecewiseTransform1DElement.
static DefaultPiecewiseTransform1DElement create(CharSequence name, NumberRange<? extends Number> valueRange)
          Creates a pass-through DefaultPiecewiseTransform1DElement.
static DefaultPiecewiseTransform1DElement create(CharSequence name, NumberRange<? extends Number> inRange, byte value)
          Builds up a DefaultPiecewiseTransform1DElement which maps a range to a constant value.
static DefaultPiecewiseTransform1DElement create(CharSequence name, NumberRange<? extends Number> inRange, double value)
          Builds up a DefaultPiecewiseTransform1DElement which maps a range to a constant value.
static DefaultPiecewiseTransform1DElement create(CharSequence name, NumberRange<? extends Number> inRange, int value)
          Builds up a DefaultPiecewiseTransform1DElement which maps a range to a constant value.
static DefaultPiecewiseTransform1DElement create(CharSequence name, NumberRange<? extends Number> inRange, NumberRange<? extends Number> outRange)
          Constructor.
static DefaultPiecewiseTransform1DElement create(String string, NumberRange<? extends Number> range, MathTransform1D mathTransform1D)
           
 Matrix derivative(DirectPosition point)
          Gets the derivative of this transform at a point.
 double derivative(double value)
          Gets the derivative of this function at a value.
 boolean equals(Object obj)
          Implementation of Object.equals(Object) for DomainElement1Ds.
protected  Class<?> getEquivalenceClass()
           
 int getSourceDimensions()
           
 int getTargetDimensions()
           
protected  MathTransform1D getTransform()
          Getter for the underlying MathTransform1D .
 int hashCode()
          Returns a hash value for this domain element.
 MathTransform1D inverse()
           
 boolean isIdentity()
           
protected  void setInverse(MathTransform1D mathTransform)
           
protected  void setTransform(MathTransform1D transform)
           
 String toString()
           
 String toWKT()
          Returns a Well Known Text (WKT) for this object.
 DirectPosition transform(DirectPosition ptSrc, DirectPosition ptDst)
          Transforms the specified ptSrc and stores the result in ptDst.
 double transform(double value)
          Transforms the specified value.
 void transform(double[] arg0, int arg1, double[] arg2, int arg3, int arg4)
           
 void transform(double[] arg0, int arg1, float[] arg2, int arg3, int arg4)
           
 void transform(float[] arg0, int arg1, double[] arg2, int arg3, int arg4)
           
 void transform(float[] arg0, int arg1, float[] arg2, int arg3, int arg4)
           
 
Methods inherited from class DefaultDomainElement1D
compareTo, contains, contains, contains, getInputMaximum, getInputMinimum, getName, getRange, isInputMaximumInfinite, isInputMaximumNaN, isInputMinimumInfinite, isInputMinimumNaN
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface DomainElement1D
contains, contains, contains, getName, getRange
 
Methods inherited from interface Comparable
compareTo
 

Constructor Detail

DefaultPiecewiseTransform1DElement

protected DefaultPiecewiseTransform1DElement(CharSequence name,
                                             NumberRange<? extends Number> valueRange)
                                      throws IllegalArgumentException
Protected constructor for DomainElement1Ds that want to build their transform later on.

Parameters:
name - for this DomainElement1D.
valueRange - for this DomainElement1D.
Throws:
IllegalArgumentException

DefaultPiecewiseTransform1DElement

protected DefaultPiecewiseTransform1DElement(CharSequence name,
                                             NumberRange<? extends Number> valueRange,
                                             MathTransform1D transform)
                                      throws IllegalArgumentException
Public constructor for building a DomainElement1D which applies the specified transformation on the values that fall into its definition range.

Parameters:
name - for this DomainElement1D.
valueRange - for this DomainElement1D.
transform - for this DomainElement1D.
Throws:
IllegalArgumentException
Method Detail

create

public static DefaultPiecewiseTransform1DElement create(CharSequence name,
                                                        NumberRange<? extends Number> inRange,
                                                        double value)
Builds up a DefaultPiecewiseTransform1DElement which maps a range to a constant value.

Parameters:
name - for this DomainElement1D
inRange - for this DomainElement1D
outVal - for this DefaultLinearPiecewiseTransform1DElement
Throws:
IllegalArgumentException - in case the input values are illegal.

create

public static DefaultPiecewiseTransform1DElement create(CharSequence name,
                                                        NumberRange<? extends Number> inRange,
                                                        byte value)
Builds up a DefaultPiecewiseTransform1DElement which maps a range to a constant value.

Parameters:
name - for this DomainElement1D
inRange - for this DomainElement1D
outVal - for this DefaultLinearPiecewiseTransform1DElement
Throws:
IllegalArgumentException - in case the input values are illegal.

create

public static DefaultPiecewiseTransform1DElement create(CharSequence name,
                                                        NumberRange<? extends Number> inRange,
                                                        int value)
Builds up a DefaultPiecewiseTransform1DElement which maps a range to a constant value.

Parameters:
name - for this DomainElement1D
inRange - for this DomainElement1D
outVal - for this DefaultLinearPiecewiseTransform1DElement
Throws:
IllegalArgumentException - in case the input values are illegal.

create

public static DefaultPiecewiseTransform1DElement create(CharSequence name,
                                                        NumberRange<? extends Number> inRange,
                                                        NumberRange<? extends Number> outRange)
Constructor.

Parameters:
name - for this DefaultLinearPiecewiseTransform1DElement.
inRange - for this DefaultLinearPiecewiseTransform1DElement.
outRange - for this DefaultLinearPiecewiseTransform1DElement.

create

public static DefaultPiecewiseTransform1DElement create(CharSequence name)
                                                 throws IllegalArgumentException
Creates a pass-through DefaultPiecewiseTransform1DElement.

Parameters:
name - for this DomainElement1D.
Throws:
IllegalArgumentException

create

public static DefaultPiecewiseTransform1DElement create(CharSequence name,
                                                        NumberRange<? extends Number> valueRange)
                                                 throws IllegalArgumentException
Creates a pass-through DefaultPiecewiseTransform1DElement.

Parameters:
name - for this DomainElement1D.
valueRange - for this DomainElement1D.
Throws:
IllegalArgumentException

toWKT

public String toWKT()
             throws UnsupportedOperationException
Returns a Well Known Text (WKT) for this object. This operation may fails if an object is too complex for the WKT format capability.

Specified by:
toWKT in interface MathTransform
Returns:
The Well Know Text for this object.
Throws:
UnsupportedOperationException - If this object can't be formatted as WKT. XXX Not yet implemented.

getTransform

protected MathTransform1D getTransform()
Getter for the underlying MathTransform1D .

Returns:
the underlying MathTransform1D .
UML property:
name="transform"

transform

public double transform(double value)
                 throws TransformException
Transforms the specified value.

Specified by:
transform in interface MathTransform1D
Parameters:
value - The value to transform.
Returns:
the transformed value.
Throws:
TransformException - if the value can't be transformed.

derivative

public double derivative(double value)
                  throws TransformException
Gets the derivative of this function at a value.

Specified by:
derivative in interface MathTransform1D
Parameters:
value - The value where to evaluate the derivative.
Returns:
The derivative at the specified point.
Throws:
TransformException - if the derivative can't be evaluated at the specified point.

transform

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

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

transform

public void transform(double[] arg0,
                      int arg1,
                      double[] arg2,
                      int arg3,
                      int arg4)
               throws TransformException
Specified by:
transform in interface MathTransform
Throws:
TransformException

transform

public void transform(float[] arg0,
                      int arg1,
                      float[] arg2,
                      int arg3,
                      int arg4)
               throws TransformException
Specified by:
transform in interface MathTransform
Throws:
TransformException

transform

public void transform(float[] arg0,
                      int arg1,
                      double[] arg2,
                      int arg3,
                      int arg4)
               throws TransformException
Throws:
TransformException

transform

public void transform(double[] arg0,
                      int arg1,
                      float[] arg2,
                      int arg3,
                      int arg4)
               throws TransformException
Throws:
TransformException

getSourceDimensions

public int getSourceDimensions()
Specified by:
getSourceDimensions in interface MathTransform

getTargetDimensions

public int getTargetDimensions()
Specified by:
getTargetDimensions in interface MathTransform

inverse

public MathTransform1D inverse()
                        throws NoninvertibleTransformException
Specified by:
inverse in interface MathTransform
Specified by:
inverse in interface MathTransform1D
Throws:
NoninvertibleTransformException

isIdentity

public boolean isIdentity()
Specified by:
isIdentity in interface MathTransform

setInverse

protected void setInverse(MathTransform1D mathTransform)
Parameters:
mathTransform -
UML property:
name="inverse"

setTransform

protected void setTransform(MathTransform1D transform)
Parameters:
transform -
UML property:
name="transform"

equals

public boolean equals(Object obj)
Description copied from class: DefaultDomainElement1D
Implementation of Object.equals(Object) for DomainElement1Ds.

Two DefaultDomainElement1Ds are considered to be equal if they have the same inputr range and the same name.

Specified by:
equals in interface DomainElement1D
Overrides:
equals in class DefaultDomainElement1D
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.equals(Object)

toString

public String toString()
Overrides:
toString in class DefaultDomainElement1D

getEquivalenceClass

protected Class<?> getEquivalenceClass()
Overrides:
getEquivalenceClass in class DefaultDomainElement1D

hashCode

public int hashCode()
Description copied from class: DefaultDomainElement1D
Returns a hash value for this domain element. This value need not remain consistent between different implementations of the same class.

Overrides:
hashCode in class DefaultDomainElement1D

create

public static DefaultPiecewiseTransform1DElement create(String string,
                                                        NumberRange<? extends Number> range,
                                                        MathTransform1D mathTransform1D)


Copyright © 1996-2009 Geotools. All Rights Reserved.