public class ObservablePatternMatchCollectionBuilder<M extends IPatternMatch>
extends java.lang.Object
create(org.eclipse.viatra.query.runtime.api.IQuerySpecification<? extends org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher<M>>)
methods to initialize a builder with a given matcher or query
specification.
setEngine(org.eclipse.viatra.query.runtime.api.ViatraQueryEngine)
,setFilter(org.eclipse.viatra.transformation.evm.api.event.EventFilter<M>)
, setComparator(java.util.Comparator<M>)
, setConverter(java.util.function.Function<M, ?>)
)
to configure the builder.
buildList()
and buildSet()
methods to create an observable
list or set as required.
Modifier | Constructor and Description |
---|---|
protected |
ObservablePatternMatchCollectionBuilder(IQuerySpecification<? extends ViatraQueryMatcher<M>> specification) |
protected |
ObservablePatternMatchCollectionBuilder(ViatraQueryMatcher<M> matcher) |
Modifier and Type | Method and Description |
---|---|
ObservablePatternMatchList<M> |
buildList()
Builds an
ObservablePatternMatchList based on the configuration set in the builder. |
ObservablePatternMatchSet<M> |
buildSet()
Builds an
ObservablePatternMatchSet based on the configuration set in the builder. |
static <M extends IPatternMatch> |
create(IQuerySpecification<? extends ViatraQueryMatcher<M>> specification)
Creates a builder for configuring an observable collection
observing the match set of the given
IQuerySpecification |
static <M extends IPatternMatch> |
create(ViatraQueryMatcher<M> matcher)
Creates a builder for configuring an observable collection
observing the match set of the given
ViatraQueryMatcher . |
ObservablePatternMatchCollectionBuilder<M> |
setComparator(java.util.Comparator<M> comparator)
The given comparator is used to define the ordering between the elements in the built observable.
|
ObservablePatternMatchCollectionBuilder<M> |
setConverter(java.util.function.Function<M,?> converter)
The given converter function is used on each match and the end result is put into the
observable collection.
|
ObservablePatternMatchCollectionBuilder<M> |
setEngine(RuleEngine engine)
Sets the given
RuleEngine to be used as the engine of the built observable. |
ObservablePatternMatchCollectionBuilder<M> |
setEngine(ViatraQueryEngine engine)
Sets the given
ViatraQueryEngine to be used as the engine of the built observable. |
ObservablePatternMatchCollectionBuilder<M> |
setFilter(java.util.Collection<M> multifilters,
ViatraQueryFilterSemantics semantics)
Sets the given collection of (partial) matches as an event filter with the given semantics
used by the built observable collection.
|
ObservablePatternMatchCollectionBuilder<M> |
setFilter(EventFilter<M> filter)
Sets the event filter used by the built observable collection.
|
ObservablePatternMatchCollectionBuilder<M> |
setFilter(M filter)
Sets the given (partial) match as an event filter used by the built observable collection.
|
protected ObservablePatternMatchCollectionBuilder(IQuerySpecification<? extends ViatraQueryMatcher<M>> specification)
protected ObservablePatternMatchCollectionBuilder(ViatraQueryMatcher<M> matcher)
public static <M extends IPatternMatch> ObservablePatternMatchCollectionBuilder<M> create(IQuerySpecification<? extends ViatraQueryMatcher<M>> specification)
IQuerySpecification
specification
- the IQuerySpecification
used to create a matcherpublic static <M extends IPatternMatch> ObservablePatternMatchCollectionBuilder<M> create(ViatraQueryMatcher<M> matcher)
ViatraQueryMatcher
.matcher
- the ViatraQueryMatcher
to use as the source of the observable collectionpublic ObservablePatternMatchCollectionBuilder<M> setFilter(EventFilter<M> filter)
public ObservablePatternMatchCollectionBuilder<M> setFilter(M filter)
public ObservablePatternMatchCollectionBuilder<M> setFilter(java.util.Collection<M> multifilters, ViatraQueryFilterSemantics semantics)
public ObservablePatternMatchCollectionBuilder<M> setEngine(ViatraQueryEngine engine)
ViatraQueryEngine
to be used as the engine of the built observable.public ObservablePatternMatchCollectionBuilder<M> setEngine(RuleEngine engine)
RuleEngine
to be used as the engine of the built observable.public ObservablePatternMatchCollectionBuilder<M> setComparator(java.util.Comparator<M> comparator)
public ObservablePatternMatchCollectionBuilder<M> setConverter(java.util.function.Function<M,?> converter)
public ObservablePatternMatchList<M> buildList()
ObservablePatternMatchList
based on the configuration set in the builder.public ObservablePatternMatchSet<M> buildSet()
ObservablePatternMatchSet
based on the configuration set in the builder.