public abstract class IncQueryEngine
extends java.lang.Object
By default, IncQueryEngines do not need to be separately disposed; they will be garbage collected along with the model.
Advanced users: see AdvancedIncQueryEngine
if you want fine control over the lifecycle of an engine.
Pattern matchers within this engine may be instantiated in the following ways:
getMatcher(IQuerySpecification)
if the pattern-specific generated matcher API is not available.
IQueryGroup
) can be initialized together before usage; this may improve
the performance of pattern matcher construction by trying to gather all necessary information from the model in one go.
Note that no such improvement is to be expected if the engine is specifically constructed in wildcard mode,
an option available in some scope implementations
(see EMFScope.EMFScope(Notifier, BaseIndexOptions)
and BaseIndexOptions.withWildcardMode(boolean)
).Constructor and Description |
---|
IncQueryEngine() |
Modifier and Type | Method and Description |
---|---|
abstract IBaseIndex |
getBaseIndex()
Provides access to the internal base index component of the engine, responsible for keeping track of basic
contents of the model.
|
abstract java.util.Set<? extends IncQueryMatcher<? extends IPatternMatch>> |
getCurrentMatchers()
Access a copy of available
IncQueryMatcher pattern matchers. |
abstract org.eclipse.emf.common.notify.Notifier |
getEMFRoot()
Deprecated.
only valid for EMF scopes; use
getScope() to get scope information in the general case. |
abstract <Matcher extends IncQueryMatcher<? extends IPatternMatch>> |
getExistingMatcher(IQuerySpecification<Matcher> querySpecification)
Access an existing pattern matcher based on a
IQuerySpecification . |
abstract <Matcher extends IncQueryMatcher<? extends IPatternMatch>> |
getMatcher(IQuerySpecification<Matcher> querySpecification)
Access a pattern matcher based on a
IQuerySpecification . |
abstract IncQueryMatcher<? extends IPatternMatch> |
getMatcher(java.lang.String patternFQN)
Access a pattern matcher for the graph pattern with the given fully qualified name.
|
java.util.Set<IQuerySpecification<? extends IncQueryMatcher<? extends IPatternMatch>>> |
getRegisteredQuerySpecifications() |
abstract IncQueryScope |
getScope() |
static IncQueryEngine |
on(IncQueryScope scope)
Obtain a (managed)
IncQueryEngine to evaluate queries over a given scope specified by an IncQueryScope . |
static IncQueryEngine |
on(org.eclipse.emf.common.notify.Notifier emfScopeRoot)
Deprecated.
use
on(IncQueryScope) instead to evaluate queries on both EMF and non-EMF scopes. |
@Deprecated public static IncQueryEngine on(org.eclipse.emf.common.notify.Notifier emfScopeRoot) throws IncQueryException
on(IncQueryScope)
instead to evaluate queries on both EMF and non-EMF scopes.IncQueryEngine
on a matcher scope specified by a scope root of type Notifier
.
For a given matcher scope, the same engine will be returned to any client. This facilitates the reuse of internal caches of the engine, greatly improving performance.
The lifecycle of this engine is centrally managed, and will not be disposed as long as the model is retained in memory. The engine will be garbage collected along with the model.
Advanced users: see AdvancedIncQueryEngine.createUnmanagedEngine(Notifier)
to obtain a private,
unmanaged engine that is not shared with other clients and allows tight control over its lifecycle.
emfScopeRoot
- the scope in which matches supported by the engine should be registeredIncQueryEngine
instanceIncQueryException
- on initialization errors.public static IncQueryEngine on(IncQueryScope scope) throws IncQueryException
IncQueryEngine
to evaluate queries over a given scope specified by an IncQueryScope
.
For a given matcher scope, the same engine will be returned to any client. This facilitates the reuse of internal caches of the engine, greatly improving performance.
The lifecycle of this engine is centrally managed, and will not be disposed as long as the model is retained in memory. The engine will be garbage collected along with the model.
Advanced users: see AdvancedIncQueryEngine.createUnmanagedEngine(IncQueryScope)
to obtain a private,
unmanaged engine that is not shared with other clients and allows tight control over its lifecycle.
scope
- the scope of query evaluation; the definition of the set of model elements that this engine is operates on.
Provide e.g. a EMFScope
for evaluating queries on an EMF model.IncQueryEngine
instanceIncQueryException
- on initialization errors.public abstract IBaseIndex getBaseIndex() throws IncQueryException
If using an EMFScope
,
consider EMFScope.extractUnderlyingEMFIndex(IncQueryEngine)
instead to access EMF-specific details.
IncQueryException
- if the base index could not be constructedpublic abstract <Matcher extends IncQueryMatcher<? extends IPatternMatch>> Matcher getMatcher(IQuerySpecification<Matcher> querySpecification) throws IncQueryException
IQuerySpecification
.
Multiple calls will return the same matcher.querySpecification
- a IQuerySpecification
that describes an IncQuery queryIncQueryException
- if the matcher could not be initializedpublic abstract IncQueryMatcher<? extends IPatternMatch> getMatcher(java.lang.String patternFQN) throws IncQueryException
patternFQN
- the fully qualified name of an IncQuery graph patternIncQueryException
- if the matcher could not be initializedpublic abstract <Matcher extends IncQueryMatcher<? extends IPatternMatch>> Matcher getExistingMatcher(IQuerySpecification<Matcher> querySpecification)
IQuerySpecification
.querySpecification
- a IQuerySpecification
that describes an IncQuery querynull
if a matcher does not exist yet.public abstract java.util.Set<? extends IncQueryMatcher<? extends IPatternMatch>> getCurrentMatchers()
IncQueryMatcher
pattern matchers.public java.util.Set<IQuerySpecification<? extends IncQueryMatcher<? extends IPatternMatch>>> getRegisteredQuerySpecifications()
@Deprecated public abstract org.eclipse.emf.common.notify.Notifier getEMFRoot()
getScope()
to get scope information in the general case.public abstract IncQueryScope getScope()