org.vizzini.math
Class AbstractScaler

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

public abstract class AbstractScaler
extends Object
implements IScaler

Provides base functionality to scale numbers between two ranges.

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

Constructor Summary
AbstractScaler()
          Construct this object.
AbstractScaler(double minInput, double maxInput, double minOutput, double maxOutput)
          Construct this object with the given parameters.
 
Method Summary
 Properties getConfiguration(String prefix)
          Return the configuration of this object.
 double getMaxInput()
          Set the maximum expected input value.
 double getMaxOutput()
          Set the maximum expected output value.
 double getMinInput()
          Set the minimum expected input value.
 double getMinOutput()
          Set the minimum expected output value.
 double[] scale(double[] inputs)
          Scale the given inputs.
 double[] scale(double[] inputs, double[] outputs)
          Scale the given inputs.
 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.
 String toString()
          Return a string representation of this object.
 double[] unscale(double[] outputs)
          Unscale the given outputs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.vizzini.math.IScaler
scale, unscale
 

Constructor Detail

AbstractScaler

public AbstractScaler()
Construct this object.

Since:
v0.1

AbstractScaler

public AbstractScaler(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

getConfiguration

public Properties getConfiguration(String prefix)
Return the configuration of this object.

Parameters:
prefix - Property name prefix.
Since:
v0.1

getMaxInput

public double getMaxInput()
Set the maximum expected input value.

Specified by:
getMaxInput in interface IScaler
Since:
v0.1

getMaxOutput

public double getMaxOutput()
Set the maximum expected output value.

Specified by:
getMaxOutput in interface IScaler
Since:
v0.1

getMinInput

public double getMinInput()
Set the minimum expected input value.

Specified by:
getMinInput in interface IScaler
Since:
v0.1

getMinOutput

public double getMinOutput()
Set the minimum expected output value.

Specified by:
getMinOutput in interface IScaler
Since:
v0.1

scale

public double[] scale(double[] inputs)
Scale the given inputs.

Specified by:
scale in interface IScaler
Since:
v0.1

scale

public double[] scale(double[] inputs,
                      double[] outputs)
Scale the given inputs.

Specified by:
scale in interface IScaler
Since:
v0.1

setMaxInput

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

Specified by:
setMaxInput in interface IScaler
Since:
v0.1

setMaxOutput

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

Specified by:
setMaxOutput in interface IScaler
Since:
v0.1

setMinInput

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

Specified by:
setMinInput in interface IScaler
Since:
v0.1

setMinOutput

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

Specified by:
setMinOutput in interface IScaler
Since:
v0.1

toString

public String toString()
Return a string representation of this object.

Specified by:
toString in interface IScaler
Overrides:
toString in class Object
Since:
v0.1

unscale

public double[] unscale(double[] outputs)
Unscale the given outputs.

Specified by:
unscale in interface IScaler
Since:
v0.1


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