com.espertech.esper.filter
Class IndexTreeBuilder

java.lang.Object
  extended by com.espertech.esper.filter.IndexTreeBuilder

public final class IndexTreeBuilder
extends java.lang.Object

Builder manipulates a tree structure consisting of FilterHandleSetNode and FilterParamIndexBase instances. Filters can be added to a top node (an instance of FilterHandleSetNode) via the add method. This method returns an instance of EventTypeIndexBuilderIndexLookupablePair which represents an element in the tree path (list of indizes) that the filter callback was added to. To remove filters the same IndexTreePath instance must be passed in.

The implementation is designed to be multithread-safe in conjunction with the node classes manipulated by this class.


Method Summary
static java.util.ArrayDeque<EventTypeIndexBuilderIndexLookupablePair>[] add(FilterValueSet filterValueSet, FilterHandle filterCallback, FilterHandleSetNode topNode, FilterServiceGranularLockFactory lockFactory)
          Add a filter callback according to the filter specification to the top node returning information to be used to remove the filter callback.
static void remove(EventType eventType, FilterHandle filterCallback, EventTypeIndexBuilderIndexLookupablePair[] treePathInfo, FilterHandleSetNode topNode)
          Remove an filterCallback from the given top node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

add

public static java.util.ArrayDeque<EventTypeIndexBuilderIndexLookupablePair>[] add(FilterValueSet filterValueSet,
                                                                                   FilterHandle filterCallback,
                                                                                   FilterHandleSetNode topNode,
                                                                                   FilterServiceGranularLockFactory lockFactory)
Add a filter callback according to the filter specification to the top node returning information to be used to remove the filter callback.

Parameters:
filterValueSet - is the filter definition
filterCallback - is the callback to be added
topNode - node to be added to any subnode beneath it
Returns:
an encapsulation of information need to allow for safe removal of the filter tree.

remove

public static void remove(EventType eventType,
                          FilterHandle filterCallback,
                          EventTypeIndexBuilderIndexLookupablePair[] treePathInfo,
                          FilterHandleSetNode topNode)
Remove an filterCallback from the given top node. The IndexTreePath instance passed in must be the same as obtained when the same filterCallback was added.

Parameters:
filterCallback - filter callback to be removed
treePathInfo - encapsulates information need to allow for safe removal of the filterCallback
topNode - The top tree node beneath which the filterCallback was added

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