com.espertech.esper.filter
Class FilterParamIndexDoubleRangeBase

java.lang.Object
  extended by com.espertech.esper.filter.FilterParamIndexBase
      extended by com.espertech.esper.filter.FilterParamIndexLookupableBase
          extended by com.espertech.esper.filter.FilterParamIndexDoubleRangeBase
All Implemented Interfaces:
EventEvaluator
Direct Known Subclasses:
FilterParamIndexDoubleRange, FilterParamIndexDoubleRangeInverted

public abstract class FilterParamIndexDoubleRangeBase
extends FilterParamIndexLookupableBase

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.


Field Summary
protected  double largestRangeValueDouble
           
protected  java.util.TreeMap<DoubleRange,EventEvaluator> ranges
           
 
Fields inherited from class com.espertech.esper.filter.FilterParamIndexLookupableBase
lookupable
 
Constructor Summary
protected FilterParamIndexDoubleRangeBase(FilterSpecLookupable lookupable, java.util.concurrent.locks.ReadWriteLock readWriteLock, FilterOperator filterOperator)
           
 
Method Summary
 EventEvaluator get(java.lang.Object expressionValue)
          Get the event evaluation instance associated with the constant.
 java.util.concurrent.locks.ReadWriteLock getReadWriteLock()
          Supplies the lock for protected access.
 void put(java.lang.Object expressionValue, EventEvaluator matcher)
          Store the event evaluation instance for the given constant.
 boolean remove(java.lang.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 com.espertech.esper.filter.FilterParamIndexLookupableBase
getLookupable, toString
 
Methods inherited from class com.espertech.esper.filter.FilterParamIndexBase
getFilterOperator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.espertech.esper.filter.EventEvaluator
matchEvent
 

Field Detail

ranges

protected final java.util.TreeMap<DoubleRange,EventEvaluator> ranges

largestRangeValueDouble

protected double largestRangeValueDouble
Constructor Detail

FilterParamIndexDoubleRangeBase

protected FilterParamIndexDoubleRangeBase(FilterSpecLookupable lookupable,
                                          java.util.concurrent.locks.ReadWriteLock readWriteLock,
                                          FilterOperator filterOperator)
Method Detail

get

public final EventEvaluator get(java.lang.Object expressionValue)
Description copied from class: FilterParamIndexLookupableBase
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 FilterParamIndexLookupableBase
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(java.lang.Object expressionValue,
                      EventEvaluator matcher)
Description copied from class: FilterParamIndexLookupableBase
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 FilterParamIndexLookupableBase
Parameters:
expressionValue - is the constant supplied in the filter parameter
matcher - to be stored for the constant

remove

public final boolean remove(java.lang.Object filterConstant)
Description copied from class: FilterParamIndexLookupableBase
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 FilterParamIndexLookupableBase
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: FilterParamIndexLookupableBase
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 FilterParamIndexLookupableBase
Returns:
Number of entries in index

getReadWriteLock

public final java.util.concurrent.locks.ReadWriteLock getReadWriteLock()
Description copied from class: FilterParamIndexLookupableBase
Supplies the lock for protected access.

Specified by:
getReadWriteLock in class FilterParamIndexLookupableBase
Returns:
lock

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com