org.vizzini.math
Class LinearScaler

java.lang.Object
  extended by org.vizzini.math.AbstractScaler
      extended by org.vizzini.math.LinearScaler
All Implemented Interfaces:
IScaler

public class LinearScaler
extends AbstractScaler

Provides functionality to linearly scale numbers between two ranges.

Since:
v0.1
Version:
v0.1
Author:
Jeffrey M. Thompson

Constructor Summary
LinearScaler()
          Construct this object.
LinearScaler(double minInput, double maxInput, double minOutput, double maxOutput)
          Construct this object with the given parameters.
 
Method Summary
 double scale(double input)
          Scale the given input to the output range.
 void setMaxInput(double max)
          Set the maximum expected input value.
 void setMaxOutput(double max)
          Set the maximum expected output value.
 void setMinInput(double min)
          Set the minimum expected input value.
 void setMinOutput(double min)
          Set the minimum expected output value.
 double unscale(double output)
          Unscale the given output to the input range.
 
Methods inherited from class org.vizzini.math.AbstractScaler
getConfiguration, getMaxInput, getMaxOutput, getMinInput, getMinOutput, scale, scale, toString, unscale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinearScaler

public LinearScaler()
Construct this object.

Since:
v0.1

LinearScaler

public LinearScaler(double minInput,
                    double maxInput,
                    double minOutput,
                    double maxOutput)
Construct this object with the given parameters.

Parameters:
minInput - Minimum expected input.
maxInput - Maximum expected input.
minOutput - Minimum expected output.
maxOutput - Maximum expected output.
Since:
v0.1
Method Detail

setMaxInput

public void setMaxInput(double max)
Set the maximum expected input value.

Specified by:
setMaxInput in interface IScaler
Overrides:
setMaxInput in class AbstractScaler
Since:
v0.1

setMaxOutput

public void setMaxOutput(double max)
Set the maximum expected output value.

Specified by:
setMaxOutput in interface IScaler
Overrides:
setMaxOutput in class AbstractScaler
Since:
v0.1

setMinInput

public void setMinInput(double min)
Set the minimum expected input value.

Specified by:
setMinInput in interface IScaler
Overrides:
setMinInput in class AbstractScaler
Since:
v0.1

setMinOutput

public void setMinOutput(double min)
Set the minimum expected output value.

Specified by:
setMinOutput in interface IScaler
Overrides:
setMinOutput in class AbstractScaler
Since:
v0.1

scale

public double scale(double input)
Scale the given input to the output range.

Since:
v0.1

unscale

public double unscale(double output)
Unscale the given output to the input range.

Since:
v0.1


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02