com.penguinwerks.jodene.data
Class RangeScaler

java.lang.Object
  extended bycom.penguinwerks.jodene.data.Scaler
      extended bycom.penguinwerks.jodene.data.RangeScaler
All Implemented Interfaces:
java.io.Serializable

public class RangeScaler
extends Scaler
implements java.io.Serializable

The range scaler scales a raw value between the min an max in a range. An example would be the Farenheit scale for weather temperatures. Normally, this would be in a range from -40 to +130. A value of -40 should be 0.0. A value of 130 should be 1.0. The mid-point is 85 which translates into 0.50. The default min max values are 0.0 and 10.0.

Author:
Paul Hoehne
See Also:
Serialized Form

Constructor Summary
RangeScaler()
           
 
Method Summary
 double getMax()
          The maximum value for the scale.
 double getMin()
          The minimum value for the scale.
 double scale(double input)
          Scale the input value so that input values at max are = 1.0 and input values at minumum are 0.0.
 void setMax(double max)
          The maximum value for the scale.
 void setMin(double min)
          The minimum value for the scale.
 
Methods inherited from class com.penguinwerks.jodene.data.Scaler
addScaler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeScaler

public RangeScaler()
Method Detail

getMax

public double getMax()
The maximum value for the scale.

Returns:
Returns the max.

setMax

public void setMax(double max)
The maximum value for the scale.

Parameters:
max - The max to set.

getMin

public double getMin()
The minimum value for the scale.

Returns:
Returns the min.

setMin

public void setMin(double min)
The minimum value for the scale.

Parameters:
min - The min to set.

scale

public double scale(double input)
Scale the input value so that input values at max are = 1.0 and input values at minumum are 0.0.

Specified by:
scale in class Scaler
Parameters:
input - The raw value.
Returns:
The scaled value.