conversion
Class LinearScaler

java.lang.Object
  extended by conversion.LinearScaler
All Implemented Interfaces:
Scaler
Direct Known Subclasses:
MutableLinearScaler

public class LinearScaler
extends java.lang.Object
implements Scaler

A LinearScaler is a scaler that uses a linear conversion formula. It is parametrized by a zero point and a slope and scales the value val to zero_point + slope*val.


Constructor Summary
LinearScaler()
          new LinearScaler() returns an identity scaler.
LinearScaler(double z, double s)
          new LinearScaler(z, s) returns a new LinearScaler with zeroPoint z and slope s.
LinearScaler(double z, double val, double sval)
          new LinearScaler(z, val, sval) a new LinearScaler with zeroPoint z that scales val to sval.
LinearScaler(double val1, double sval1, double val2, double sval2)
          new LinearScaler(val1, sval1, val2, sval2) returns a new LinearScaler that scales val1 to sval1 and val2 to sval2.
 
Method Summary
protected  void doSetScale(double z, double s)
          doSetScale(val) adjusts this linear scaler to have zero point z and slope s.
protected  void doSetScale(double z, double val, double sval)
          doSetScale(val) adjusts this linear scaler to have zero point z and to scale val to sval.
protected  void doSetScale(double val1, double sval1, double val2, double sval2)
          doSetScale(val) adjusts this linear scaler to scale val1 to sval1 and val2 to sval2.
 Scaler getReverseScaler()
          ls.getReverseScaler() returns a scaler that performs scaling that is inverse to ls' scaling.
 double scale(double val)
          ls.scale(val) returns ls's scaled value for val.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearScaler

public LinearScaler()
new LinearScaler() returns an identity scaler. That is, both scale() and reverseScale() return their argument values unchanged.


LinearScaler

public LinearScaler(double z,
                    double s)
new LinearScaler(z, s) returns a new LinearScaler with zeroPoint z and slope s.

Parameters:
z -
s -

LinearScaler

public LinearScaler(double z,
                    double val,
                    double sval)
new LinearScaler(z, val, sval) a new LinearScaler with zeroPoint z that scales val to sval.

Parameters:
z -
val -
sval -

LinearScaler

public LinearScaler(double val1,
                    double sval1,
                    double val2,
                    double sval2)
new LinearScaler(val1, sval1, val2, sval2) returns a new LinearScaler that scales val1 to sval1 and val2 to sval2.

Parameters:
val1 -
sval1 -
val2 -
sval2 -
Method Detail

doSetScale

protected void doSetScale(double z,
                          double s)
doSetScale(val) adjusts this linear scaler to have zero point z and slope s.

Parameters:
z -
s -

doSetScale

protected void doSetScale(double z,
                          double val,
                          double sval)
doSetScale(val) adjusts this linear scaler to have zero point z and to scale val to sval.

Parameters:
z -
val -
sval -

doSetScale

protected void doSetScale(double val1,
                          double sval1,
                          double val2,
                          double sval2)
doSetScale(val) adjusts this linear scaler to scale val1 to sval1 and val2 to sval2.

Parameters:
val1 -
sval1 -
val2 -
sval2 -

scale

public double scale(double val)
ls.scale(val) returns ls's scaled value for val.

Specified by:
scale in interface Scaler
Parameters:
val -
Returns:

getReverseScaler

public Scaler getReverseScaler()
ls.getReverseScaler() returns a scaler that performs scaling that is inverse to ls' scaling. The returned scaler tracks changes in parameters that control ls's scaling.

Specified by:
getReverseScaler in interface Scaler
Returns: