com.espertech.esper.filter
Class FilterParamIndexLookupableBase

java.lang.Object
  extended by com.espertech.esper.filter.FilterParamIndexBase
      extended by com.espertech.esper.filter.FilterParamIndexLookupableBase
All Implemented Interfaces:
EventEvaluator
Direct Known Subclasses:
FilterParamIndexCompare, FilterParamIndexCompareString, FilterParamIndexDoubleRangeBase, FilterParamIndexEqualsBase, FilterParamIndexIn, FilterParamIndexNotEqualsBase, FilterParamIndexNotIn, FilterParamIndexStringRangeBase

public abstract class FilterParamIndexLookupableBase
extends FilterParamIndexBase

Each implementation of this abstract class represents an index of filter parameter constants supplied in filter parameters in filter specifications that feature the same event property and operator.

For example, a filter with a parameter of "count EQUALS 10" would be represented as index for a property named "count" and for a filter operator typed "EQUALS". The index would store a value of "10" in its internal structure.

Implementations make sure that the type of the Object constant in get and put calls matches the event property type.


Field Summary
protected  FilterSpecLookupable lookupable
           
 
Constructor Summary
FilterParamIndexLookupableBase(FilterOperator filterOperator, FilterSpecLookupable lookupable)
          Constructor.
 
Method Summary
protected abstract  EventEvaluator get(java.lang.Object filterConstant)
          Get the event evaluation instance associated with the constant.
 FilterSpecLookupable getLookupable()
           
protected abstract  java.util.concurrent.locks.ReadWriteLock getReadWriteLock()
          Supplies the lock for protected access.
protected abstract  void put(java.lang.Object filterConstant, EventEvaluator evaluator)
          Store the event evaluation instance for the given constant.
protected abstract  boolean remove(java.lang.Object filterConstant)
          Remove the event evaluation instance for the given constant.
protected abstract  int size()
          Return the number of distinct filter parameter constants stored.
 java.lang.String 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

lookupable

protected final FilterSpecLookupable lookupable
Constructor Detail

FilterParamIndexLookupableBase

public FilterParamIndexLookupableBase(FilterOperator filterOperator,
                                      FilterSpecLookupable lookupable)
Constructor.

Parameters:
filterOperator - is the type of comparison performed.
lookupable - is the lookupable
Method Detail

get

protected abstract EventEvaluator get(java.lang.Object filterConstant)
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 FilterParamIndexBase
Parameters:
filterConstant - is the constant supplied in the event filter parameter
Returns:
event evaluator stored for the filter constant, or null if not found

put

protected abstract void put(java.lang.Object filterConstant,
                            EventEvaluator evaluator)
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 FilterParamIndexBase
Parameters:
filterConstant - is the constant supplied in the filter parameter
evaluator - to be stored for the constant

remove

protected abstract boolean remove(java.lang.Object filterConstant)
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 FilterParamIndexBase
Parameters:
filterConstant - is the value supplied in the filter paremeter
Returns:
true if found and removed, false if not found

size

protected abstract int size()
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 FilterParamIndexBase
Returns:
Number of entries in index

getReadWriteLock

protected abstract java.util.concurrent.locks.ReadWriteLock getReadWriteLock()
Supplies the lock for protected access.

Specified by:
getReadWriteLock in class FilterParamIndexBase
Returns:
lock

toString

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

getLookupable

public FilterSpecLookupable getLookupable()

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