visad.data.in
Class ValueRanger
- java.lang.Object
-
- visad.data.in.ValueProcessor
-
- visad.data.in.ValueRanger
-
public class ValueRanger extends ValueProcessor
Provides support for ranging data values (i.e. checking to see that they lie within a valid range).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.doublegetMax()Returns the maximum, valid value.doublegetMin()Returns the minimum, valid value.inthashCode()Returns the hash code of this instance.doubleprocess(double value)Ranges a value.double[]process(double[] values)Ranges values.floatprocess(float value)Ranges a value.float[]process(float[] values)Ranges values.static ValueRangervalueRanger(double lower, double upper)Returns an instance of this class corresponding to valid-range limits.
-
-
-
Method Detail
-
valueRanger
public static ValueRanger valueRanger(double lower, double upper)
Returns an instance of this class corresponding to valid-range limits.- Parameters:
lower- The lower limit of the valid range. May be NaN or Double.NEGATIVE_INFINITY to indicate no limit.upper- The upper limit of the valid range. May be NaN or Double.POSITIVE_INFINITY to indicate no limit.
-
getMin
public double getMin()
Returns the minimum, valid value.- Returns:
- The minimum, valid value.
-
getMax
public double getMax()
Returns the maximum, valid value.- Returns:
- The maximum, valid value.
-
process
public float process(float value)
Ranges a value.- Specified by:
processin classValueProcessor- Parameters:
value- The value to be processed.- Returns:
- The original value if it lay within the valid range; otherwise Float.NaN.
-
process
public double process(double value)
Ranges a value.- Specified by:
processin classValueProcessor- Parameters:
value- The values to be processed.- Returns:
- The original value if it lay within the valid range; otherwise Double.NaN.
-
process
public float[] process(float[] values)
Ranges values.- Specified by:
processin classValueProcessor- Parameters:
values- The value to be processed.- Returns:
- The original array with values that fall outside the valid range replaced with Float.NaN.
-
process
public double[] process(double[] values)
Ranges values.- Specified by:
processin classValueProcessor- Parameters:
values- The values to be processed.- Returns:
- The original array with values that fall outside the valid range replaced with Double.NaN.
-
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