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.NumericDataFilter

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

public abstract class NumericDataFilter
extends DataFilter
a class that defines a general tranformation for a Number from one domain into another.

Note that the input Number need not be of the same specific subclass type as the output, and vice versa. This is advantageous when one wants to conserve memory by storing data with one type but presenting the with another. For example, data may be stored as shorts (16-bit) but presented to the user as a floating-point (32- or 64-bit) measurement. Despite this specific use, this class is fairly general in design.

The methods forward() and reverse() apply the transform to a single datum. What defines the forward transform is in general completely arbitrary and up to the specific implementations; however, Horizon uses the convention that the forward transform produces a value that is closer to what the user wishes to see.

This abstract class enforces explicit cloneability via the ExplicitlyCloneable interface by providing a public clone() method. Thus, subclasses should override this method as appropriate.

See Also:
DataFilter, LinearDataFilter, Serialized Form

Constructor Summary
NumericDataFilter()
           
 
Method Summary
java.lang.Object forward(java.lang.Object inval)
          apply a forward transform to the datum
java.lang.Number forward(java.lang.Number inval)
          apply a forward transform to a Number
java.lang.Object reverse(java.lang.Object inval)
          apply a reverse transform to the datum
java.lang.Number reverse(java.lang.Number inval)
          apply a reverse transform to a Number
boolean supportsForwardType(java.lang.Class type)
          return true if the this filter can support a given type as input to the forward transformation.
boolean supportsReverseType(java.lang.Class type)
          return true if the this filter can support a given type as input to the reverse transformation.
 
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
 

Constructor Detail

NumericDataFilter

public NumericDataFilter()
Method Detail

forward

public final java.lang.Object forward(java.lang.Object inval)
                              throws java.lang.IllegalArgumentException
apply a forward transform to the datum
Throws:
java.lang.IllegalArgumentException - if the input value is not a Number
Overrides:
forward in class DataFilter

supportsForwardType

public final boolean supportsForwardType(java.lang.Class type)
return true if the this filter can support a given type as input to the forward transformation.
Overrides:
supportsForwardType in class DataFilter

supportsReverseType

public final boolean supportsReverseType(java.lang.Class type)
return true if the this filter can support a given type as input to the reverse transformation.
Overrides:
supportsReverseType in class DataFilter

forward

public abstract java.lang.Number forward(java.lang.Number inval)
apply a forward transform to a Number

reverse

public final java.lang.Object reverse(java.lang.Object inval)
                              throws java.lang.IllegalArgumentException
apply a reverse transform to the datum
Throws:
java.lang.IllegalArgumentException - if the input value is not a Number
Overrides:
reverse in class DataFilter

reverse

public abstract java.lang.Number reverse(java.lang.Number inval)
apply a reverse transform to a Number

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