Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class ncsa.horizon.util.LinearDataFilter

java.lang.Object
  |
  +--ncsa.horizon.util.DataFilter
        |
        +--ncsa.horizon.util.NumericDataFilter
              |
              +--ncsa.horizon.util.LinearDataFilter

public class LinearDataFilter
extends NumericDataFilter
a class that defines a linear tranformation for a Number from one domain into another.

This transformation encapsulates a scaling, M, and an offset, B, defining the forward transform as F(x) = Mx + B.

See Also:
DataFilter, NumericDataFilter, Serialized Form

Field Summary
boolean fwdround
          if true, the forward result will be rounded to the nearest integer.
double offset
          the offset for the linear transformation
boolean revround
          if true, the reverse result will be rounded to the nearest integer.
double scale
          the scaling factor for the linear transform
 
Constructor Summary
LinearDataFilter()
          Create a do-nothing filter.
LinearDataFilter(double scale, double offset)
          Create a linear filter.
LinearDataFilter(double scale, double offset, boolean roundOnForward, boolean roundOnReverse)
          Create a linear filter.
 
Method Summary
java.lang.Number forward(java.lang.Number inval)
           
java.lang.Number reverse(java.lang.Number inval)
           
java.lang.String toString()
           
 
Methods inherited from class ncsa.horizon.util.NumericDataFilter
forward, forward, reverse, reverse, supportsForwardType, supportsReverseType
 
Methods inherited from class ncsa.horizon.util.DataFilter
clone, forward, reverse, supportsForwardType, supportsReverseType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

scale

protected double scale
the scaling factor for the linear transform

offset

protected double offset
the offset for the linear transformation

fwdround

protected boolean fwdround
if true, the forward result will be rounded to the nearest integer.

revround

protected boolean revround
if true, the reverse result will be rounded to the nearest integer.
Constructor Detail

LinearDataFilter

public LinearDataFilter()
Create a do-nothing filter. The scaling will be 1.0 and the offset, 0.0.

LinearDataFilter

public LinearDataFilter(double scale,
                        double offset)
Create a linear filter.

LinearDataFilter

public LinearDataFilter(double scale,
                        double offset,
                        boolean roundOnForward,
                        boolean roundOnReverse)
Create a linear filter. The results of the transforms can be rounded to the nearest integer as requested.
Parameters:
scale - the scale parameter for the transform
offset - the offset parameter for the transform
roundOnForward - if true, the result of the forward transform will rounded to the nearest integer
roundOnReverse - if true, the result of the forward transform will rounded to the nearest integer
Method Detail

forward

public java.lang.Number forward(java.lang.Number inval)
Overrides:
forward in class NumericDataFilter

reverse

public java.lang.Number reverse(java.lang.Number inval)
Overrides:
reverse in class NumericDataFilter

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD