public final class FilterHandleSetNode extends Object implements EventEvaluator
FilterParamIndexBase
nodes
and a set of FilterHandle
.
An instance of this class represents a leaf-node (no indizes stored, just filter callbacks)
but can also be non-leaf (some indizes exist) in a filter evaluation tree.
Events are evaluated by asking each of the indizes to evaluate the event and by
adding any filter callbacks in this node to the "matches" list of callbacks.Constructor and Description |
---|
FilterHandleSetNode(ReadWriteLock nodeRWLock) |
Modifier and Type | Method and Description |
---|---|
void |
add(FilterHandle filterCallback)
Add a filter callback.
|
void |
add(FilterParamIndexBase index)
Add an index.
|
boolean |
contains(FilterHandle filterCallback)
Returns an indication whether the filter callback exists in this node.
|
Set<FilterHandle> |
getCallbackSet() |
int |
getFilterCallbackCount()
Returns the number of filter callbacks stored.
|
List<FilterParamIndexBase> |
getIndizes()
Returns list of indexes - not returning an iterator.
|
ReadWriteLock |
getNodeRWLock()
Returns to lock to use for making changes to the filter callback or inzides collections stored by this node.
|
boolean |
isEmpty()
Returns an indication of whether there are any callbacks or index nodes at all in this set.
|
void |
matchEvent(EventBean theEvent,
Collection<FilterHandle> matches)
Evaluate an event by asking each index to match the event.
|
boolean |
remove(FilterHandle filterCallback)
Remove a filter callback, returning true if it was found and removed or false if not in collection.
|
boolean |
remove(FilterParamIndexBase index)
Remove an index, returning true if it was found and removed or false if not in collection.
|
public FilterHandleSetNode(ReadWriteLock nodeRWLock)
public boolean isEmpty()
public int getFilterCallbackCount()
public final ReadWriteLock getNodeRWLock()
public List<FilterParamIndexBase> getIndizes()
public final void matchEvent(EventBean theEvent, Collection<FilterHandle> matches)
matchEvent
in interface EventEvaluator
theEvent
- is the event wrapper supplying the event property valuesmatches
- is the list of callbacks to add to for any matches foundpublic boolean contains(FilterHandle filterCallback)
filterCallback
- is the filter callback to check forpublic final void add(FilterParamIndexBase index)
index
- - index to addpublic final boolean remove(FilterParamIndexBase index)
index
- is the index to removepublic final void add(FilterHandle filterCallback)
filterCallback
- is the callback to addpublic final boolean remove(FilterHandle filterCallback)
filterCallback
- is the callback to removepublic Set<FilterHandle> getCallbackSet()