org.epics.pvmanager
Class ExpressionLanguage.Filter<T>

java.lang.Object
  extended by org.epics.pvmanager.ExpressionLanguage.Filter<T>
Type Parameters:
T - the type to cast to before the filtering
Enclosing class:
ExpressionLanguage

public abstract static class ExpressionLanguage.Filter<T>
extends java.lang.Object

Filters a data stream, removing updates that match the given function. Looks for objects of a specific type, and filters based on previous and current value.


Constructor Summary
ExpressionLanguage.Filter(java.lang.Class<T> clazz)
          Creates a filter which looks for and cases data objects of the given class.
ExpressionLanguage.Filter(java.lang.Class<T> clazz, boolean filterUnmatched)
          Creates a filter which looks for and cases data objects of the given class.
 
Method Summary
 ExpressionLanguage.Filter<?> and(ExpressionLanguage.Filter<?> filter)
          Returns a new filter that is the logical AND of this and the given one.
abstract  boolean filter(T previousValue, T currentValue)
          Determines whether the new value should be filtered or not.
 ExpressionLanguage.Filter<?> or(ExpressionLanguage.Filter<?> filter)
          Returns a new filter that is the logical OR of this and the given one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionLanguage.Filter

public ExpressionLanguage.Filter(java.lang.Class<T> clazz)
Creates a filter which looks for and cases data objects of the given class.

Parameters:
clazz - the argument type of the filter

ExpressionLanguage.Filter

public ExpressionLanguage.Filter(java.lang.Class<T> clazz,
                                 boolean filterUnmatched)
Creates a filter which looks for and cases data objects of the given class. If objects do not match, returns filterUnmatched.

Parameters:
clazz - the argument type of the filter
filterUnmatched - whether objects that don't match the class should be filtered or not
Method Detail

filter

public abstract boolean filter(T previousValue,
                               T currentValue)
Determines whether the new value should be filtered or not. The filtering is done based on the previousValue, which is always a value that passed the filtering. The first value ever to be passed to the filter will have null for previousValue.

Parameters:
previousValue - the previous data update
currentValue - the current data update
Returns:
true if the current data update should be dropped

and

public ExpressionLanguage.Filter<?> and(ExpressionLanguage.Filter<?> filter)
Returns a new filter that is the logical AND of this and the given one.

Parameters:
filter - another filter
Returns:
a new filter that is the AND of the two

or

public ExpressionLanguage.Filter<?> or(ExpressionLanguage.Filter<?> filter)
Returns a new filter that is the logical OR of this and the given one.

Parameters:
filter - another filter
Returns:
a new filter that is the OR of the two