本文整理了Java中org.eclipse.viatra.query.runtime.api.ViatraQueryEngine.getMatcher()
方法的一些代码示例,展示了ViatraQueryEngine.getMatcher()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ViatraQueryEngine.getMatcher()
方法的具体详情如下:
包路径:org.eclipse.viatra.query.runtime.api.ViatraQueryEngine
类名称:ViatraQueryEngine
方法名:getMatcher
[英]Access a pattern matcher for the graph pattern with the given fully qualified name. Will succeed only if a query specification for this fully qualified name has been generated and registered. Multiple calls will return the same matcher unless the registered specification changes.
[中]使用给定的完全限定名访问图形模式的模式匹配器。仅当已生成并注册此完全限定名的查询规范时,才会成功。除非注册的规范发生更改,否则多个调用将返回相同的匹配器。
代码示例来源:origin: org.eclipse.viatra/org.eclipse.viatra.query.runtime
/**
* Internal method for {@link GenericQuerySpecification}
* @noreference
*/
static <Matcher extends GenericPatternMatcher> GenericPatternMatcher instantiate(ViatraQueryEngine engine, GenericQuerySpecification<Matcher> querySpecification) {
// check if matcher already exists
GenericPatternMatcher matcher = engine.getExistingMatcher(querySpecification);
if (matcher == null) {
matcher = engine.getMatcher(querySpecification);
}
return matcher;
}
代码示例来源:origin: org.eclipse.viatra/org.eclipse.viatra.query.patternlanguage.emf
/**
* Initializes the pattern matcher within an existing VIATRA Query engine.
* If the pattern matcher is already constructed in the engine, only a
* light-weight reference is returned. The match set will be incrementally
* refreshed upon updates.
*
* @param engine
* the existing VIATRA Query engine in which this matcher will be
* created.
* @param querySpecification
* the query specification for which the matcher is to be
* constructed.
* @throws ViatraQueryRuntimeException
* if an error occurs during pattern matcher creation
*/
public static GenericPatternMatcher on(ViatraQueryEngine engine,
GenericQuerySpecification querySpecification) {
// check if matcher already exists
GenericPatternMatcher matcher = engine.getExistingMatcher(querySpecification);
if (matcher == null) {
matcher = engine.getMatcher(querySpecification);
}
return matcher;
}
内容来源于网络,如有侵权,请联系作者删除!