com.espertech.esper.filter
Class FilterParamIndexBase

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

public abstract class FilterParamIndexBase
extends java.lang.Object
implements EventEvaluator

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.


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

Constructor Detail

FilterParamIndexBase

public FilterParamIndexBase(FilterOperator filterOperator)
Constructor.

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

get

public 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.

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

public 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.

Parameters:
filterConstant - is the constant supplied in the filter parameter
evaluator - to be stored for the constant

remove

public 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.

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

size

public 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.

Returns:
Number of entries in index

getReadWriteLock

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

Returns:
lock

getFilterOperator

public final FilterOperator getFilterOperator()
Returns the filter operator that the index matches for.

Returns:
filter operator

toString

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

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