com.penguinwerks.jodene.data
Class FactorScaler

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

public class FactorScaler
extends Scaler
implements java.io.Serializable

A factor scaler is an instance of scaler that divides the input value by the given factor. For exmaple, a factor of 3, would divide the input value by 3. A common use of the FactorScaler would be to divide the raw values so they appear in a given range - 0.00 to 1.00. The temperature, in Celsius might be divided by a scale of 40.00 so that temperature readings might range between -1.0 and 1.0.

Author:
Paul Hoehne
See Also:
Serialized Form

Constructor Summary
FactorScaler()
          Constructors - empty contructor;
FactorScaler(double factor)
          Constructor that takes a factor as an argument.
 
Method Summary
 double getFactor()
          The factor to use.
 double scale(double input)
          Scales the input value, dividing by the given factor.
 void setFactor(double factor)
          The factor to use.
 
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

FactorScaler

public FactorScaler()
Constructors - empty contructor;


FactorScaler

public FactorScaler(double factor)
Constructor that takes a factor as an argument.

Parameters:
factor - The factor for this scaler.
Method Detail

getFactor

public double getFactor()
The factor to use. A key point is that the input value will be DIVIDED BY the factor.

Returns:
Returns the factor.

setFactor

public void setFactor(double factor)
The factor to use. A key point is that the input value will be DIVIDED BY the factor.

Parameters:
factor - The factor to set.

scale

public double scale(double input)
Scales the input value, dividing by the given factor.

Specified by:
scale in class Scaler
Parameters:
input - The raw input value.
Returns:
The input value divided by the factor.