diff options
Diffstat (limited to 'subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/IQueryGroup.java')
-rw-r--r-- | subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/IQueryGroup.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/IQueryGroup.java b/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/IQueryGroup.java new file mode 100644 index 00000000..a783f823 --- /dev/null +++ b/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/IQueryGroup.java | |||
@@ -0,0 +1,46 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2012, Mark Czotter, Istvan Rath and Daniel Varro | ||
3 | * This program and the accompanying materials are made available under the | ||
4 | * terms of the Eclipse Public License v. 2.0 which is available at | ||
5 | * http://www.eclipse.org/legal/epl-v20.html. | ||
6 | * | ||
7 | * SPDX-License-Identifier: EPL-2.0 | ||
8 | *******************************************************************************/ | ||
9 | package tools.refinery.viatra.runtime.api; | ||
10 | |||
11 | import java.util.Set; | ||
12 | |||
13 | /** | ||
14 | * Generic interface for group of query specifications. | ||
15 | * | ||
16 | * <p>It handles more than one patterns as a group, and provides functionality to initialize the matchers together (which | ||
17 | * has performance benefits). | ||
18 | * | ||
19 | * @author Mark Czotter | ||
20 | * | ||
21 | */ | ||
22 | public interface IQueryGroup { | ||
23 | |||
24 | /** | ||
25 | * Initializes matchers for the group of patterns within an {@link ViatraQueryEngine}. If some of the pattern matchers are already | ||
26 | * constructed in the engine, no task is performed for them. | ||
27 | * | ||
28 | * <p> | ||
29 | * This preparation step has the advantage that it prepares pattern matchers for an arbitrary number of patterns in a | ||
30 | * single-pass traversal of the model. | ||
31 | * This is typically more efficient than traversing the model each time an individual pattern matcher is initialized on demand. | ||
32 | * The performance benefit only manifests itself if the engine is not in wildcard mode. | ||
33 | * | ||
34 | * @param engine | ||
35 | * the existing VIATRA Query engine in which the matchers will be created. | ||
36 | * @throws ViatraQueryRuntimeException | ||
37 | * if there was an error in preparing the engine | ||
38 | */ | ||
39 | public void prepare(ViatraQueryEngine engine); | ||
40 | |||
41 | /** | ||
42 | * Returns the currently assigned {@link IQuerySpecification}s. | ||
43 | */ | ||
44 | public Set<IQuerySpecification<?>> getSpecifications(); | ||
45 | |||
46 | } | ||