diff options
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java | 162 |
1 files changed, 162 insertions, 0 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java new file mode 100644 index 00000000..d6f5c53b --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java | |||
@@ -0,0 +1,162 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.LinkedHashSet; | ||
8 | import java.util.List; | ||
9 | import java.util.Set; | ||
10 | import org.eclipse.emf.ecore.EClass; | ||
11 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
13 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
14 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
15 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
25 | |||
26 | /** | ||
27 | * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way. | ||
28 | * | ||
29 | * <p>Original source: | ||
30 | * <code><pre> | ||
31 | * private pattern directCommunicationLink(Source : CommunicatingElement, Target : CommunicatingElement) { | ||
32 | * DirectedCommunicationLink.source(Link, SourceSubsystem); | ||
33 | * DirectedCommunicationLink.target(Link, TargetSubsystem); | ||
34 | * CommunicatingElement.commSubsystem(Source, SourceSubsystem); | ||
35 | * CommunicatingElement.commSubsystem(Target, TargetSubsystem); | ||
36 | * } | ||
37 | * </pre></code> | ||
38 | * | ||
39 | * @see GenericPatternMatcher | ||
40 | * @see GenericPatternMatch | ||
41 | * | ||
42 | */ | ||
43 | @SuppressWarnings("all") | ||
44 | public final class DirectCommunicationLink extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
45 | private DirectCommunicationLink() { | ||
46 | super(GeneratedPQuery.INSTANCE); | ||
47 | } | ||
48 | |||
49 | /** | ||
50 | * @return the singleton instance of the query specification | ||
51 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
52 | * | ||
53 | */ | ||
54 | public static DirectCommunicationLink instance() { | ||
55 | try{ | ||
56 | return LazyHolder.INSTANCE; | ||
57 | } catch (ExceptionInInitializerError err) { | ||
58 | throw processInitializerError(err); | ||
59 | } | ||
60 | } | ||
61 | |||
62 | /** | ||
63 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink (visibility: PUBLIC, simpleName: DirectCommunicationLink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
64 | * <b>not</b> at the class load time of the outer class, | ||
65 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink (visibility: PUBLIC, simpleName: DirectCommunicationLink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
66 | * | ||
67 | * <p> This workaround is required e.g. to support recursion. | ||
68 | * | ||
69 | */ | ||
70 | private static class LazyHolder { | ||
71 | private static final DirectCommunicationLink INSTANCE = new DirectCommunicationLink(); | ||
72 | |||
73 | /** | ||
74 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
75 | * This initialization order is required to support indirect recursion. | ||
76 | * | ||
77 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
78 | * | ||
79 | */ | ||
80 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
81 | |||
82 | public static Object ensureInitialized() { | ||
83 | INSTANCE.ensureInitializedInternal(); | ||
84 | return null; | ||
85 | } | ||
86 | } | ||
87 | |||
88 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
89 | private static final DirectCommunicationLink.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
90 | |||
91 | private final PParameter parameter_Source = new PParameter("Source", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); | ||
92 | |||
93 | private final PParameter parameter_Target = new PParameter("Target", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); | ||
94 | |||
95 | private final List<PParameter> parameters = Arrays.asList(parameter_Source, parameter_Target); | ||
96 | |||
97 | private GeneratedPQuery() { | ||
98 | super(PVisibility.PRIVATE); | ||
99 | } | ||
100 | |||
101 | @Override | ||
102 | public String getFullyQualifiedName() { | ||
103 | return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.directCommunicationLink"; | ||
104 | } | ||
105 | |||
106 | @Override | ||
107 | public List<String> getParameterNames() { | ||
108 | return Arrays.asList("Source","Target"); | ||
109 | } | ||
110 | |||
111 | @Override | ||
112 | public List<PParameter> getParameters() { | ||
113 | return parameters; | ||
114 | } | ||
115 | |||
116 | @Override | ||
117 | public Set<PBody> doGetContainedBodies() { | ||
118 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
119 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
120 | { | ||
121 | PBody body = new PBody(this); | ||
122 | PVariable var_Source = body.getOrCreateVariableByName("Source"); | ||
123 | PVariable var_Target = body.getOrCreateVariableByName("Target"); | ||
124 | PVariable var_Link = body.getOrCreateVariableByName("Link"); | ||
125 | PVariable var_SourceSubsystem = body.getOrCreateVariableByName("SourceSubsystem"); | ||
126 | PVariable var_TargetSubsystem = body.getOrCreateVariableByName("TargetSubsystem"); | ||
127 | new TypeConstraint(body, Tuples.flatTupleOf(var_Source), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
128 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
129 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
130 | new ExportedParameter(body, var_Source, parameter_Source), | ||
131 | new ExportedParameter(body, var_Target, parameter_Target) | ||
132 | )); | ||
133 | // DirectedCommunicationLink.source(Link, SourceSubsystem) | ||
134 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | ||
135 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
136 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "source"))); | ||
137 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
138 | new Equality(body, var__virtual_0_, var_SourceSubsystem); | ||
139 | // DirectedCommunicationLink.target(Link, TargetSubsystem) | ||
140 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | ||
141 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
142 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "target"))); | ||
143 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
144 | new Equality(body, var__virtual_1_, var_TargetSubsystem); | ||
145 | // CommunicatingElement.commSubsystem(Source, SourceSubsystem) | ||
146 | new TypeConstraint(body, Tuples.flatTupleOf(var_Source), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
147 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
148 | new TypeConstraint(body, Tuples.flatTupleOf(var_Source, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); | ||
149 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
150 | new Equality(body, var__virtual_2_, var_SourceSubsystem); | ||
151 | // CommunicatingElement.commSubsystem(Target, TargetSubsystem) | ||
152 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); | ||
153 | PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}"); | ||
154 | new TypeConstraint(body, Tuples.flatTupleOf(var_Target, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); | ||
155 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
156 | new Equality(body, var__virtual_3_, var_TargetSubsystem); | ||
157 | bodies.add(body); | ||
158 | } | ||
159 | return bodies; | ||
160 | } | ||
161 | } | ||
162 | } | ||