Class DefaultPiecewiseTransform1DElement
Object
DefaultDomainElement1D
DefaultPiecewiseTransform1DElement
- All Implemented Interfaces:
Serializable,Comparable<DomainElement1D>,DomainElement1D,PiecewiseTransform1DElement
- Direct Known Subclasses:
DefaultLinearPiecewiseTransform1DElement,DefaultPassthroughPiecewiseTransform1DElement
public class DefaultPiecewiseTransform1DElement
extends DefaultDomainElement1D
implements PiecewiseTransform1DElement
Convenience implementation of the
DefaultPiecewiseTransform1DElement .- Author:
- Simone Giannecchini, GeoSolutions
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultPiecewiseTransform1DElement(CharSequence name, Range valueRange) Protected constructor forDomainElement1Ds that want to build their transform later on.DefaultPiecewiseTransform1DElement(CharSequence name, Range valueRange, MathTransformation transform) Public constructor for building aDomainElement1Dwhich applies the specified transformation on the values that fall into its definition range. -
Method Summary
Modifier and TypeMethodDescriptioncreate(CharSequence name) Creates a pass-through DefaultPiecewiseTransform1DElement.create(CharSequence name, Range valueRange) Creates a pass-through DefaultPiecewiseTransform1DElement.create(CharSequence name, Range inRange, byte value) Builds up a DefaultPiecewiseTransform1DElement which maps a range to a constant value.create(CharSequence name, Range inRange, double value) Builds up aDefaultPiecewiseTransform1DElementwhich maps a range to a constant value.create(CharSequence name, Range inRange, int value) Builds up a DefaultPiecewiseTransform1DElement which maps a range to a constant value.create(CharSequence name, Range inRange, Range outRange) Constructor.create(String string, Range range, MathTransformation mathTransform1D) booleanImplementation ofObject.equals(Object)forDomainElement1Ds.intReturns the input transformation dimensionsintReturns the output transformation dimensionsinthashCode()Returns a hash value for this domain element.inverse()Returns the inverse of thisMathTransformationinstancebooleanDefines if the transformation is an identitydoubletransform(double value) Transforms the specified value.Transforms the specifiedptSrcand stores the result inptDst.Methods inherited from class DefaultDomainElement1D
compareTo, contains, contains, contains, getInputMaximum, getInputMinimum, getName, getRange, isInputMaximumInfinite, isInputMaximumNaN, isInputMinimumInfinite, isInputMinimumNaN, toStringMethods inherited from interface Comparable
compareTo
-
Constructor Details
-
DefaultPiecewiseTransform1DElement
public DefaultPiecewiseTransform1DElement(CharSequence name, Range valueRange) throws IllegalArgumentException Protected constructor forDomainElement1Ds that want to build their transform later on.- Parameters:
name- for thisDomainElement1D.valueRange- for thisDomainElement1D.- Throws:
IllegalArgumentException
-
DefaultPiecewiseTransform1DElement
public DefaultPiecewiseTransform1DElement(CharSequence name, Range valueRange, MathTransformation transform) throws IllegalArgumentException Public constructor for building aDomainElement1Dwhich applies the specified transformation on the values that fall into its definition range.- Parameters:
name- for thisDomainElement1D.valueRange- for thisDomainElement1D.transform- for thisDomainElement1D.- Throws:
IllegalArgumentException
-
-
Method Details
-
create
public static DefaultPiecewiseTransform1DElement create(CharSequence name, Range inRange, double value) Builds up aDefaultPiecewiseTransform1DElementwhich maps a range to a constant value.- Parameters:
name- for thisDomainElement1DinRange- for thisDomainElement1DoutVal- for thisDefaultLinearPiecewiseTransform1DElement- Throws:
IllegalArgumentException- in case the input values are illegal.
-
create
public static DefaultPiecewiseTransform1DElement create(CharSequence name, Range inRange, byte value) Builds up a DefaultPiecewiseTransform1DElement which maps a range to a constant value.- Parameters:
name- for thisDomainElement1DinRange- for thisDomainElement1DoutVal- for thisDefaultLinearPiecewiseTransform1DElement- Throws:
IllegalArgumentException- in case the input values are illegal.
-
create
public static DefaultPiecewiseTransform1DElement create(CharSequence name, Range inRange, int value) Builds up a DefaultPiecewiseTransform1DElement which maps a range to a constant value.- Parameters:
name- for thisDomainElement1DinRange- for thisDomainElement1DoutVal- for thisDefaultLinearPiecewiseTransform1DElement- Throws:
IllegalArgumentException- in case the input values are illegal.
-
create
public static DefaultPiecewiseTransform1DElement create(CharSequence name, Range inRange, Range outRange) Constructor.- Parameters:
name- for thisDefaultLinearPiecewiseTransform1DElement.inRange- for thisDefaultLinearPiecewiseTransform1DElement.outRange- for thisDefaultLinearPiecewiseTransform1DElement.
-
create
public static DefaultPiecewiseTransform1DElement create(CharSequence name) throws IllegalArgumentException Creates a pass-through DefaultPiecewiseTransform1DElement.- Parameters:
name- for thisDomainElement1D.- Throws:
IllegalArgumentException
-
create
public static DefaultPiecewiseTransform1DElement create(CharSequence name, Range valueRange) throws IllegalArgumentException Creates a pass-through DefaultPiecewiseTransform1DElement.- Parameters:
name- for thisDomainElement1D.valueRange- for thisDomainElement1D.- Throws:
IllegalArgumentException
-
transform
Transforms the specified value.- Specified by:
transformin interfacePiecewiseTransform1DElement- Parameters:
value- The value to transform.- Returns:
- the transformed value.
- Throws:
TransformationException- if the value can't be transformed.
-
transform
Transforms the specifiedptSrcand stores the result inptDst.- Throws:
TransformationException
-
getSourceDimensions
public int getSourceDimensions()Returns the input transformation dimensions -
getTargetDimensions
public int getTargetDimensions()Returns the output transformation dimensions -
inverse
Returns the inverse of thisMathTransformationinstance- Throws:
NoninvertibleTransformException
-
isIdentity
public boolean isIdentity()Defines if the transformation is an identity -
equals
Description copied from class:DefaultDomainElement1DImplementation ofObject.equals(Object)forDomainElement1Ds.Two
DefaultDomainElement1Ds are considered to be equal if they have the same inputr range and the same name.- Specified by:
equalsin interfaceDomainElement1D- Overrides:
equalsin classDefaultDomainElement1D- Parameters:
obj- the reference object with which to compare.- Returns:
trueif this object is the same as the obj argument;falseotherwise.- See Also:
-
hashCode
public int hashCode()Description copied from class:DefaultDomainElement1DReturns a hash value for this domain element. This value need not remain consistent between different implementations of the same class.- Overrides:
hashCodein classDefaultDomainElement1D
-
create
public static DefaultPiecewiseTransform1DElement create(String string, Range range, MathTransformation mathTransform1D)
-