public 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 and Type | Method and Description |
---|---|
static <T,F extends T> |
apply(Pattern<T,F> jPattern)
Constructs a new Pattern by wrapping a given Java API Pattern
|
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.
|
scala.Option<FilterFunction<F>> |
getFilterFunction() |
String |
getName() |
scala.Option<Pattern<T,? extends T>> |
getPrevious() |
scala.Option<Time> |
getWindowTime() |
Pattern<T,T> |
next(String name)
Appends a new pattern operator to the existing one.
|
<S extends F> |
subtype(Class<S> clazz)
Applies a subtype constraint on the current pattern operator.
|
Pattern<T,F> |
where(FilterFunction<F> filter)
Specifies a filter condition which has to be fulfilled by an event in order to be matched.
|
Pattern<T,F> |
where(scala.Function1<F,Object> filterFun)
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.
|
Pattern<T,F> |
wrappedPattern() |
public static <T,F extends T> Pattern<T,F> apply(Pattern<T,F> jPattern)
jPattern
- Underlying Java API Pattern.public static <X> Pattern<X,X> begin(String name)
name
- Name of the new pattern operatorpublic String getName()
public scala.Option<Time> getWindowTime()
public scala.Option<FilterFunction<F>> getFilterFunction()
public <S extends F> Pattern<T,S> subtype(Class<S> clazz)
clazz
- 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 Pattern<T,F> where(FilterFunction<F> filter)
filter
- Filter conditionpublic Pattern<T,F> where(scala.Function1<F,Object> filterFun)
filterFun
- Filter conditionCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.