visad.data.in
Class ScaleAndOffsetUnpacker
- java.lang.Object
-
- visad.data.in.ValueProcessor
-
- visad.data.in.ValueUnpacker
-
- visad.data.in.ScaleAndOffsetUnpacker
-
public final class ScaleAndOffsetUnpacker extends ValueUnpacker
Provides support for unpacking data values by multiplying them by a constant scale factor and then adding a constant offset value.Instances are immutable.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object obj)Indicates if this instance is semantically identical to another object.doublegetIncrement()Returns the absolute value of the scale value.inthashCode()Returns the hash code of this instance.doubleprocess(double value)Process a value.double[]process(double[] values)Process values.floatprocess(float value)Process a value.float[]process(float[] values)Process values.static ScaleAndOffsetUnpackerscaleAndOffsetUnpacker(double scale, double offset)Returns an instance of this class corresponding to an offset value and scale factor.-
Methods inherited from class visad.data.in.ValueUnpacker
valueUnpacker
-
-
-
-
Method Detail
-
scaleAndOffsetUnpacker
public static ScaleAndOffsetUnpacker scaleAndOffsetUnpacker(double scale, double offset)
Returns an instance of this class corresponding to an offset value and scale factor.- Parameters:
scale- The numeric amount to multiply each value by during processing.offset- The numeric offset to be added to each value during processing.- Returns:
- An instance of this class corresponding to the input arguments.
-
getIncrement
public double getIncrement()
Returns the absolute value of the scale value.- Overrides:
getIncrementin classValueUnpacker- Returns:
- The absolute value of the scale value.
-
process
public float process(float value)
Process a value.- Specified by:
processin classValueProcessor- Parameters:
value- The value to be processed.- Returns:
- The value with the construction offset added to it.
-
process
public double process(double value)
Process a value.- Specified by:
processin classValueProcessor- Parameters:
value- The value to be processed.- Returns:
- The value with the construction offset added to it.
-
process
public float[] process(float[] values)
Process values.- Specified by:
processin classValueProcessor- Parameters:
values- The values to be processed.- Returns:
- The values with the construction offset added to them. The same array is returned.
-
process
public double[] process(double[] values)
Process values.- Specified by:
processin classValueProcessor- Parameters:
values- The values to be processed.- Returns:
- The values with the construction offset added to them. The same array is returned.
-
equals
public boolean equals(java.lang.Object obj)
Indicates if this instance is semantically identical to another object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- The other object.- Returns:
trueif and only if this instance is semantically identical to the other object.
-
hashCode
public int hashCode()
Returns the hash code of this instance.- Overrides:
hashCodein classjava.lang.Object- Returns:
- The hash code of this instance.
-
-
DMelt 3.0 © DataMelt by jWork.ORG