diff options
Diffstat (limited to 'subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/CallWithAdornment.java')
-rw-r--r-- | subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/CallWithAdornment.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/CallWithAdornment.java b/subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/CallWithAdornment.java new file mode 100644 index 00000000..0cabeb97 --- /dev/null +++ b/subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/matcher/CallWithAdornment.java | |||
@@ -0,0 +1,55 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2018, Gabor Bergmann, IncQuery Labs Ltd. | ||
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.localsearch.matcher; | ||
10 | |||
11 | import java.util.HashSet; | ||
12 | import java.util.Set; | ||
13 | |||
14 | import tools.refinery.viatra.runtime.matchers.psystem.IQueryReference; | ||
15 | import tools.refinery.viatra.runtime.matchers.psystem.PConstraint; | ||
16 | import tools.refinery.viatra.runtime.matchers.psystem.queries.PParameter; | ||
17 | import tools.refinery.viatra.runtime.matchers.psystem.queries.PQuery; | ||
18 | |||
19 | /** | ||
20 | * Immutable data that represents the role of a pattern call within an LS query plan. | ||
21 | * | ||
22 | * <p> The call is expressed as the {@link PConstraint} {@link #call} (implementing {@link IQueryReference}), | ||
23 | * while the stored {@link #adornment} records the way it will be used within a search plan (specifically, | ||
24 | * pattern parameters within the adornment will have their values known at the point of evaluating the constraint). | ||
25 | * | ||
26 | * | ||
27 | * @author Gabor Bergmann | ||
28 | * @since 2.1 | ||
29 | */ | ||
30 | public class CallWithAdornment { | ||
31 | private final IQueryReference call; | ||
32 | private final Set<PParameter> adornment; | ||
33 | |||
34 | public CallWithAdornment(IQueryReference call, Set<PParameter> adornment) { | ||
35 | this.call = call; | ||
36 | this.adornment = new HashSet<>(adornment); | ||
37 | } | ||
38 | |||
39 | public IQueryReference getCall() { | ||
40 | return call; | ||
41 | } | ||
42 | |||
43 | public Set<PParameter> getAdornment() { | ||
44 | return adornment; | ||
45 | } | ||
46 | |||
47 | |||
48 | public PQuery getReferredQuery() { | ||
49 | return call.getReferredQuery(); | ||
50 | } | ||
51 | |||
52 | public MatcherReference getMatcherReference() { | ||
53 | return new MatcherReference(getReferredQuery(), adornment); | ||
54 | } | ||
55 | } | ||