org.mbari.siam.utils
Class RangeFilter

java.lang.Object
  extended by org.mbari.siam.utils.Filter
      extended by org.mbari.siam.utils.RangeFilter

public class RangeFilter
extends Filter

This filter evaluates the value of its (single) input against a specified range of values. The output is updated if the value is within the specified range. If the input value is outside the valid range, there are several options, set by a member variable: - REJECT : reject the value; do not change output - USE_LAST_VALID : output last valid input value - USE_AVERAGE : average up to _average_n previous valid values - USE_CONSTANT : use the same constant value


Field Summary
protected static org.apache.log4j.Logger _log4j
          Log4j logger
protected  java.lang.StringBuffer _stringBuffer
           
protected  RangeValidator _validator
           
 
Fields inherited from class org.mbari.siam.utils.Filter
ACTION_CANCEL, ACTION_OK, DEFAULT_ID, DEFAULT_NAME
 
Constructor Summary
RangeFilter()
           
RangeFilter(java.lang.String name, int id, FilterInput input, RangeValidator validator)
           
 
Method Summary
protected  int doFilterAction(double value)
          Perform the filter function with the new input value.
 void setBounds(int region, double lowerBound, double upperBound, boolean includeLower, boolean includeUpper)
           
 void setConstant(double constant, boolean allowOutsideRange)
           
 void setRejectPolicy(int policy)
           
 java.lang.String toString()
           
 
Methods inherited from class org.mbari.siam.utils.Filter
addInput, addInputs, attach, doubleValue, floatValue, getID, getInput, getInput, indexOf, inputCount, inputGate, intValue, longValue, name, outputGate, removeAllInputs, removeInput, reset, setID, setName, triggerIn, triggerOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_log4j

protected static org.apache.log4j.Logger _log4j
Log4j logger


_validator

protected RangeValidator _validator

_stringBuffer

protected java.lang.StringBuffer _stringBuffer
Constructor Detail

RangeFilter

public RangeFilter()

RangeFilter

public RangeFilter(java.lang.String name,
                   int id,
                   FilterInput input,
                   RangeValidator validator)
            throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

setBounds

public void setBounds(int region,
                      double lowerBound,
                      double upperBound,
                      boolean includeLower,
                      boolean includeUpper)
               throws java.lang.Exception
Throws:
java.lang.Exception

setConstant

public void setConstant(double constant,
                        boolean allowOutsideRange)
                 throws java.lang.Exception
Throws:
java.lang.Exception

setRejectPolicy

public void setRejectPolicy(int policy)
                     throws java.lang.Exception
Throws:
java.lang.Exception

doFilterAction

protected int doFilterAction(double value)
Perform the filter function with the new input value. Sets member variable _filterValue, which will be passed to the output by triggerOut() if the output gating conditions are met. Overrides base class default.

Specified by:
doFilterAction in class Filter

toString

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


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.