org.geotools.referencing.piecewise
Class DefaultPiecewiseTransform1D<T extends DefaultPiecewiseTransform1DElement>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by org.geotools.referencing.piecewise.DefaultDomain1D<T>
              extended by org.geotools.referencing.piecewise.DefaultPiecewiseTransform1D<T>
All Implemented Interfaces:
java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>, Domain1D<T>, PiecewiseTransform1D<T>, org.opengis.referencing.operation.MathTransform, org.opengis.referencing.operation.MathTransform1D

public class DefaultPiecewiseTransform1D<T extends DefaultPiecewiseTransform1DElement>
extends DefaultDomain1D<T>
implements PiecewiseTransform1D<T>

Convenience implementation of the PiecewiseTransform1D interface which subclass the DefaultDomain1D class in order to provide a suitable framework to handle a list of PiecewiseTransform1DElement s.

Author:
Simone Giannecchini, GeoSolutions

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DefaultPiecewiseTransform1D(T[] domainElements)
           
DefaultPiecewiseTransform1D(T[] domainElements, double defaultValue)
           
 
Method Summary
 org.opengis.referencing.operation.Matrix derivative(org.opengis.geometry.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(java.lang.Object object)
          Compares the specified object with this domain element list for equality.
 double getDefaultValue()
          The default value which will be returned when asked to transform a value outside the valid domain elements.
protected  java.lang.Class<?> getEquivalenceClass()
           
 int getSourceDimensions()
          Gets the dimension of input points, which is 1.
 int getTargetDimensions()
          Gets the dimension of output points, which is 1.
 boolean hasDefaultValue()
          Indicates whether or not this PiecewiseTransform1D has a default value which will be returned when asked to transform a value outside the valid domain elements.
 int hashCode()
           
 org.opengis.referencing.operation.MathTransform1D inverse()
           
 boolean isIdentity()
           
 java.lang.String toWKT()
           
 org.opengis.geometry.DirectPosition transform(org.opengis.geometry.DirectPosition ptSrc, org.opengis.geometry.DirectPosition ptDst)
           
 double transform(double value)
           
 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 org.geotools.referencing.piecewise.DefaultDomain1D
findDomainElement, get, getApproximateDomainRange, getMain, getMinimums, getName, hasGaps, size, toArray
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.geotools.referencing.piecewise.Domain1D
findDomainElement, getApproximateDomainRange, getName, hasGaps
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Constructor Detail

DefaultPiecewiseTransform1D

public DefaultPiecewiseTransform1D(T[] domainElements,
                                   double defaultValue)

DefaultPiecewiseTransform1D

public DefaultPiecewiseTransform1D(T[] domainElements)
Method Detail

transform

public double transform(double value)
                 throws org.opengis.referencing.operation.TransformException
Specified by:
transform in interface org.opengis.referencing.operation.MathTransform1D
Throws:
org.opengis.referencing.operation.TransformException

derivative

public org.opengis.referencing.operation.Matrix derivative(org.opengis.geometry.DirectPosition point)
                                                    throws org.opengis.referencing.operation.TransformException
Gets the derivative of this transform at a point.

Specified by:
derivative in interface org.opengis.referencing.operation.MathTransform
Throws:
org.opengis.referencing.operation.TransformException

derivative

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

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

getSourceDimensions

public final int getSourceDimensions()
Gets the dimension of input points, which is 1.

Specified by:
getSourceDimensions in interface org.opengis.referencing.operation.MathTransform

getTargetDimensions

public final int getTargetDimensions()
Gets the dimension of output points, which is 1.

Specified by:
getTargetDimensions in interface org.opengis.referencing.operation.MathTransform

inverse

public org.opengis.referencing.operation.MathTransform1D inverse()
                                                          throws org.opengis.referencing.operation.NoninvertibleTransformException
Specified by:
inverse in interface org.opengis.referencing.operation.MathTransform
Specified by:
inverse in interface org.opengis.referencing.operation.MathTransform1D
Throws:
org.opengis.referencing.operation.NoninvertibleTransformException

isIdentity

public boolean isIdentity()
Specified by:
isIdentity in interface org.opengis.referencing.operation.MathTransform

toWKT

public java.lang.String toWKT()
                       throws java.lang.UnsupportedOperationException
Specified by:
toWKT in interface org.opengis.referencing.operation.MathTransform
Throws:
java.lang.UnsupportedOperationException

transform

public org.opengis.geometry.DirectPosition transform(org.opengis.geometry.DirectPosition ptSrc,
                                                     org.opengis.geometry.DirectPosition ptDst)
                                              throws org.opengis.geometry.MismatchedDimensionException,
                                                     org.opengis.referencing.operation.TransformException
Specified by:
transform in interface org.opengis.referencing.operation.MathTransform
Throws:
org.opengis.geometry.MismatchedDimensionException
org.opengis.referencing.operation.TransformException

transform

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

Specified by:
transform in interface org.opengis.referencing.operation.MathTransform
Throws:
org.opengis.referencing.operation.TransformException

transform

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

Specified by:
transform in interface org.opengis.referencing.operation.MathTransform
Throws:
org.opengis.referencing.operation.TransformException

transform

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

Specified by:
transform in interface org.opengis.referencing.operation.MathTransform
Throws:
org.opengis.referencing.operation.TransformException

transform

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

Specified by:
transform in interface org.opengis.referencing.operation.MathTransform
Throws:
org.opengis.referencing.operation.TransformException

hasDefaultValue

public boolean hasDefaultValue()
Description copied from interface: PiecewiseTransform1D
Indicates whether or not this PiecewiseTransform1D has a default value which will be returned when asked to transform a value outside the valid domain elements.

Specified by:
hasDefaultValue in interface PiecewiseTransform1D<T extends DefaultPiecewiseTransform1DElement>
Returns:
a boolean to indicate whether or not this PiecewiseTransform1D has a default value.

getDefaultValue

public double getDefaultValue()
Description copied from interface: PiecewiseTransform1D
The default value which will be returned when asked to transform a value outside the valid domain elements.

In case PiecewiseTransform1D.hasDefaultValue() return false this value has no meaning.

Specified by:
getDefaultValue in interface PiecewiseTransform1D<T extends DefaultPiecewiseTransform1DElement>
Returns:

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection<T extends DefaultPiecewiseTransform1DElement>
Specified by:
hashCode in interface java.util.List<T extends DefaultPiecewiseTransform1DElement>
Overrides:
hashCode in class DefaultDomain1D<T extends DefaultPiecewiseTransform1DElement>

equals

public boolean equals(java.lang.Object object)
Description copied from class: DefaultDomain1D
Compares the specified object with this domain element list for equality. If the two objects are instances of the DefaultDomain1D class, then the test check for the equality of the single elements.

Specified by:
equals in interface java.util.Collection<T extends DefaultPiecewiseTransform1DElement>
Specified by:
equals in interface java.util.List<T extends DefaultPiecewiseTransform1DElement>
Overrides:
equals in class DefaultDomain1D<T extends DefaultPiecewiseTransform1DElement>

getEquivalenceClass

protected java.lang.Class<?> getEquivalenceClass()
Overrides:
getEquivalenceClass in class DefaultDomain1D<T extends DefaultPiecewiseTransform1DElement>


Copyright © 1996-2010 Geotools. All Rights Reserved.