diff options
Diffstat (limited to 'Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/Ecore2CftTransformation.java')
-rw-r--r-- | Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/Ecore2CftTransformation.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/Ecore2CftTransformation.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/Ecore2CftTransformation.java new file mode 100644 index 00000000..8b2d9d97 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.transformation/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/transformation/ecore2cft/Ecore2CftTransformation.java | |||
@@ -0,0 +1,35 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft; | ||
2 | |||
3 | import com.google.common.collect.ImmutableList; | ||
4 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.MappingDefinition; | ||
5 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.TransformationDefinition; | ||
6 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.ComponentFaultTreeTrace; | ||
7 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.MappingHandler; | ||
8 | import hu.bme.mit.inf.dslreasoner.faulttree.transformation.ecore2cft.MappingQueries; | ||
9 | import java.util.List; | ||
10 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
11 | import org.eclipse.xtext.xbase.lib.Functions.Function1; | ||
12 | import org.eclipse.xtext.xbase.lib.ListExtensions; | ||
13 | |||
14 | @SuppressWarnings("all") | ||
15 | public class Ecore2CftTransformation { | ||
16 | private final List<MappingHandler> mappingHandlers; | ||
17 | |||
18 | public Ecore2CftTransformation(final TransformationDefinition transformationDefinition, final ViatraQueryEngine viatraQueryEngine) { | ||
19 | final MappingQueries mappingQueries = new MappingQueries(transformationDefinition, viatraQueryEngine); | ||
20 | final Function1<MappingDefinition, MappingHandler> _function = (MappingDefinition mappingDefinition) -> { | ||
21 | return new MappingHandler(mappingDefinition, mappingQueries); | ||
22 | }; | ||
23 | this.mappingHandlers = ImmutableList.<MappingHandler>copyOf(ListExtensions.<MappingDefinition, MappingHandler>map(transformationDefinition.getMappingDefinitions(), _function)); | ||
24 | } | ||
25 | |||
26 | public void createComponentFaultTree() { | ||
27 | final ComponentFaultTreeTrace trace = new ComponentFaultTreeTrace(); | ||
28 | for (final MappingHandler handler : this.mappingHandlers) { | ||
29 | handler.instantiateComponents(trace); | ||
30 | } | ||
31 | for (final MappingHandler handler_1 : this.mappingHandlers) { | ||
32 | handler_1.instantiateConnections(trace); | ||
33 | } | ||
34 | } | ||
35 | } | ||