net.esper.filter
Class FilterParamIndexRange

java.lang.Object
  extended by net.esper.filter.FilterParamIndexBase
      extended by net.esper.filter.FilterParamIndexPropBase
          extended by net.esper.filter.FilterParamIndexRange
All Implemented Interfaces:
EventEvaluator

public final class FilterParamIndexRange
extends FilterParamIndexPropBase

Index for filter parameter constants for the range operators (range open/closed/half). The implementation is based on the SortedMap implementation of TreeMap and stores only expression parameter values of type DoubleRange.


Constructor Summary
FilterParamIndexRange(String attributeName, FilterOperator filterOperator, EventType eventType)
          Constructs the index for matching ranges.
 
Method Summary
 EventEvaluator get(Object expressionValue)
          Get the event evaluation instance associated with the constant.
 ReadWriteLock getReadWriteLock()
          Supplies the lock for protected access.
 void matchEvent(EventBean eventBean, Collection<FilterHandle> matches)
          Perform the matching of an event based on the event property values, adding any callbacks for matches found to the matches list.
 void put(Object expressionValue, EventEvaluator matcher)
          Store the event evaluation instance for the given constant.
 boolean remove(Object filterConstant)
          Remove the event evaluation instance for the given constant.
 int size()
          Return the number of distinct filter parameter constants stored.
 
Methods inherited from class net.esper.filter.FilterParamIndexPropBase
getGetter, getPropertyBoxedType, getPropertyName, toString
 
Methods inherited from class net.esper.filter.FilterParamIndexBase
getFilterOperator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FilterParamIndexRange

public FilterParamIndexRange(String attributeName,
                             FilterOperator filterOperator,
                             EventType eventType)
Constructs the index for matching ranges.

Parameters:
attributeName - is the name of the event attribute field
filterOperator - is the type of range
eventType - is type of events handled
Method Detail

get

public final EventEvaluator get(Object expressionValue)
Description copied from class: FilterParamIndexPropBase
Get the event evaluation instance associated with the constant. Returns null if no entry found for the constant. The calling class must make sure that access to the underlying resource is protected for multi-threaded access, the getReadWriteLock() method must supply a lock for this purpose.

Specified by:
get in class FilterParamIndexPropBase
Parameters:
expressionValue - is the constant supplied in the event filter parameter
Returns:
event evaluator stored for the filter constant, or null if not found

put

public final void put(Object expressionValue,
                      EventEvaluator matcher)
Description copied from class: FilterParamIndexPropBase
Store the event evaluation instance for the given constant. Can override an existing value for the same constant. The calling class must make sure that access to the underlying resource is protected for multi-threaded access, the getReadWriteLock() method must supply a lock for this purpose.

Specified by:
put in class FilterParamIndexPropBase
Parameters:
expressionValue - is the constant supplied in the filter parameter
matcher - to be stored for the constant

remove

public final boolean remove(Object filterConstant)
Description copied from class: FilterParamIndexPropBase
Remove the event evaluation instance for the given constant. Returns true if the constant was found, or false if not. The calling class must make sure that access to the underlying resource is protected for multi-threaded writes, the getReadWriteLock() method must supply a lock for this purpose.

Specified by:
remove in class FilterParamIndexPropBase
Parameters:
filterConstant - is the value supplied in the filter paremeter
Returns:
true if found and removed, false if not found

size

public final int size()
Description copied from class: FilterParamIndexPropBase
Return the number of distinct filter parameter constants stored. The calling class must make sure that access to the underlying resource is protected for multi-threaded writes, the getReadWriteLock() method must supply a lock for this purpose.

Specified by:
size in class FilterParamIndexPropBase
Returns:
Number of entries in index

getReadWriteLock

public final ReadWriteLock getReadWriteLock()
Description copied from class: FilterParamIndexPropBase
Supplies the lock for protected access.

Specified by:
getReadWriteLock in class FilterParamIndexPropBase
Returns:
lock

matchEvent

public final void matchEvent(EventBean eventBean,
                             Collection<FilterHandle> matches)
Description copied from interface: EventEvaluator
Perform the matching of an event based on the event property values, adding any callbacks for matches found to the matches list.

Parameters:
eventBean - is the event object wrapper to obtain event property values from
matches - accumulates the matching filter callbacks