Package se.sics.kompics
Class MatchedHandler<P,V,E extends PatternExtractor<P,? super V>>
java.lang.Object
se.sics.kompics.MatchedHandler<P,V,E>
- Type Parameters:
P
- The type of the pattern to match againstV
- The type of the content valueE
- The type of context event
- Direct Known Subclasses:
ClassMatchedHandler
public abstract class MatchedHandler<P,V,E extends PatternExtractor<P,? super V>> extends Object
Base class for matching handlers, which use an extracted value to "pattern match" against.
A pattern matching handler separates an incoming event into a context and a content part. It passes
them separately to the
handle(Object, PatternExtractor)
method.- Author:
- Lars Kroll <[email protected]>
-
Constructor Summary
Constructors Modifier Constructor Description protected
MatchedHandler()
protected
MatchedHandler(Class<E> contextType)
-
Method Summary
Modifier and Type Method Description Class<E>
getContextType()
Gets the context type.Class<E>
getCxtType()
Deprecated.Since 1.2.0, usegetContextType()
instead.abstract void
handle(V content, E context)
abstract P
pattern()
void
setContextType(Class<E> contextType)
Sets the context type.void
setCxtType(Class<E> cxtType)
Deprecated.Since 1.2.0, usesetContextType(Class)
instead.
-
Constructor Details
-
MatchedHandler
protected MatchedHandler() -
MatchedHandler
-
-
Method Details
-
pattern
-
handle
-
setCxtType
Deprecated.Since 1.2.0, usesetContextType(Class)
instead. Method will be dropped in 1.3.0!Sets the context type.- Parameters:
cxtType
- the context type
-
setContextType
Sets the context type.- Parameters:
contextType
- the type of the context
-
getCxtType
Deprecated.Since 1.2.0, usegetContextType()
instead. Method will be dropped in 1.3.0!Gets the context type.- Returns:
- the context type
-
getContextType
Gets the context type.- Returns:
- the context type
-