org.mbari.siam.utils
Class Filter

java.lang.Object
  extended by org.mbari.siam.utils.Filter
Direct Known Subclasses:
BoxcarFilter, HeadingFilter, MagnitudeFilter, RangeFilter, UnityFilter, WeightedAverageFilter

public abstract class Filter
extends java.lang.Object


Field Summary
protected static org.apache.log4j.Logger _log4j
          Log4j logger
static int ACTION_CANCEL
           
static int ACTION_OK
           
static int DEFAULT_ID
           
static java.lang.String DEFAULT_NAME
           
 
Constructor Summary
Filter()
           
Filter(java.lang.String name, int id)
           
Filter(java.lang.String name, int id, java.util.Vector inputs)
           
 
Method Summary
 void addInput(FilterInput input)
           
 void addInputs(java.util.Vector inputs)
           
 void attach(FilterInput input)
          Attach this Filter's output to a FilterInput
protected abstract  int doFilterAction(double value)
          Perform the filter function with the new input value.
 double doubleValue()
           
 float floatValue()
           
 int getID()
           
 FilterInput getInput(int index)
           
 FilterInput getInput(java.lang.String key)
          Get a named input.
 int indexOf(java.lang.String key)
           
 int inputCount()
           
 boolean inputGate()
          Gate filter processing based on logic in this method.
 int intValue()
           
 long longValue()
           
 java.lang.String name()
           
 boolean outputGate()
          Gate filter output based on logic in this method.
 void removeAllInputs()
           
 void removeInput(java.lang.String key)
          Remove the first input with name=key.
 void reset()
          Reset filter.
 void setID(int id)
           
 void setName(java.lang.String name)
           
 java.lang.String toString()
           
 void triggerIn(FilterInput input)
          Notify the filter that an input value is available.
protected  void triggerOut()
          Propagate outputs pending output gating function.
 
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


ACTION_OK

public static final int ACTION_OK
See Also:
Constant Field Values

ACTION_CANCEL

public static final int ACTION_CANCEL
See Also:
Constant Field Values

DEFAULT_ID

public static final int DEFAULT_ID
See Also:
Constant Field Values

DEFAULT_NAME

public static final java.lang.String DEFAULT_NAME
See Also:
Constant Field Values
Constructor Detail

Filter

public Filter()

Filter

public Filter(java.lang.String name,
              int id)

Filter

public Filter(java.lang.String name,
              int id,
              java.util.Vector inputs)
       throws InvalidPropertyException
Throws:
InvalidPropertyException
Method Detail

setName

public void setName(java.lang.String name)

name

public java.lang.String name()

setID

public void setID(int id)

getID

public int getID()

addInputs

public void addInputs(java.util.Vector inputs)
               throws InvalidPropertyException
Throws:
InvalidPropertyException

addInput

public void addInput(FilterInput input)
              throws InvalidPropertyException
Throws:
InvalidPropertyException

attach

public void attach(FilterInput input)
Attach this Filter's output to a FilterInput


getInput

public FilterInput getInput(java.lang.String key)
Get a named input. Use key Filter.DEFAULT_INPUT_KEY to get the the default input. returns null if the requested input does not exist


getInput

public FilterInput getInput(int index)

removeInput

public void removeInput(java.lang.String key)
Remove the first input with name=key. If no input with this name exists, the inputs


removeAllInputs

public void removeAllInputs()

indexOf

public int indexOf(java.lang.String key)

inputCount

public int inputCount()

inputGate

public boolean inputGate()
Gate filter processing based on logic in this method. For example, may not perform processing if some inputs haven't changed. By default, returns true, allowing processing to occur.


outputGate

public boolean outputGate()
Gate filter output based on logic in this method. For example, may not change output if some inputs haven't changed. By default, returns true, allowing processing to occur.


triggerIn

public void triggerIn(FilterInput input)
Notify the filter that an input value is available. Trigger filter action based on gating function.


triggerOut

protected void triggerOut()
Propagate outputs pending output gating function.


doFilterAction

protected abstract 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. Default action is to pass values to output.


reset

public void reset()
Reset filter. Does nothing by default. Subclasses may use this to provide a way to reset the filter.


doubleValue

public double doubleValue()

floatValue

public float floatValue()

intValue

public int intValue()

longValue

public long longValue()

toString

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


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.