T
- Base type of the elements appearing in the patternF
- Subtype of T to which the current pattern operator is constrainedpublic class Pattern<T,F extends T> extends Object
A pattern definition is used by NFACompiler
to create
a NFA
.
Pattern<T, F> pattern = Pattern.<T>begin("start")
.next("middle").subtype(F.class)
.followedBy("end").where(new MyFilterFunction());
Modifier | Constructor and Description |
---|---|
protected |
Pattern(String name,
Pattern<T,?> previous) |
Modifier and Type | Method and Description |
---|---|
static <X> Pattern<X,X> |
begin(String name)
Starts a new pattern with the initial pattern operator whose name is provided.
|
FollowedByPattern<T,T> |
followedBy(String name)
Appends a new pattern operator to the existing one.
|
FilterFunction<F> |
getFilterFunction() |
String |
getName() |
Pattern<T,?> |
getPrevious() |
Time |
getWindowTime() |
Pattern<T,T> |
next(String name)
Appends a new pattern operator to the existing one.
|
<S extends F> |
subtype(Class<S> subtypeClass)
Applies a subtype constraint on the current pattern operator.
|
Pattern<T,F> |
where(FilterFunction<F> newFilterFunction)
Specifies a filter condition which has to be fulfilled by an event in order to be matched.
|
Pattern<T,F> |
within(Time windowTime)
Defines the maximum time interval for a matching pattern.
|
public String getName()
public FilterFunction<F> getFilterFunction()
public Time getWindowTime()
public Pattern<T,F> where(FilterFunction<F> newFilterFunction)
newFilterFunction
- Filter conditionpublic <S extends F> Pattern<T,S> subtype(Class<S> subtypeClass)
S
- Type of the subtypesubtypeClass
- Class of the subtypepublic Pattern<T,F> within(Time windowTime)
windowTime
- Time of the matching windowpublic Pattern<T,T> next(String name)
name
- Name of the new pattern operatorpublic FollowedByPattern<T,T> followedBy(String name)
name
- Name of the new pattern operatorpublic static <X> Pattern<X,X> begin(String name)
X
- Base type of the event patternname
- Name of the new pattern operatorCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.