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

java.lang.Object
  |
  +--ncsa.horizon.util.DataFilter
Subclasses:
ColorDataFilter, NumericDataFilter, TrivialDataFilter

public abstract class DataFilter
extends java.lang.Object
implements java.io.Serializable, ExplicitlyCloneable
a class that defines a general tranformation for a datum from one domain into another.

This is used by Horizon to allow data measurements to be stored in an array with one set of units but presented to the user with another. This is advantageous if the user units are more complex or require more memory. 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:
NumericDataFilter, LinearDataFilter, Serialized Form

Constructor Summary
DataFilter()
           
 
Method Summary
java.lang.Object clone()
          clone this filter
java.lang.Object forward(java.lang.Object inval)
          apply a forward transform to the datum
java.lang.Object reverse(java.lang.Object inval)
          apply a reverse transform to the datum
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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Constructor Detail

DataFilter

public DataFilter()
Method Detail

forward

public abstract 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 of the wrong type for this filter.

reverse

public abstract 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 of the wrong type for this filter.

supportsForwardType

public abstract boolean supportsForwardType(java.lang.Class type)
return true if the this filter can support a given type as input to the forward transformation.

supportsReverseType

public abstract boolean supportsReverseType(java.lang.Class type)
return true if the this filter can support a given type as input to the reverse transformation.

clone

public java.lang.Object clone()
clone this filter
Specified by:
clone in interface ExplicitlyCloneable
Overrides:
clone 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