1 | package de.uka.ipd.sdq.pcm.transformations.builder.seff; |
2 | |
3 | import java.util.ArrayList; |
4 | import java.util.Collection; |
5 | |
6 | import de.uka.ipd.sdq.pcm.parameter.VariableUsage; |
7 | import de.uka.ipd.sdq.pcm.seff.AbstractAction; |
8 | import de.uka.ipd.sdq.pcm.seff.SeffFactory; |
9 | import de.uka.ipd.sdq.pcm.seff.SetVariableAction; |
10 | |
11 | public class SetVariableActionDescriptor extends AbstractActionDescriptor { |
12 | private Collection<VariableUsage> vus; |
13 | |
14 | public SetVariableActionDescriptor(Collection<VariableUsage> vus) { |
15 | super(); |
16 | this.vus = vus; |
17 | } |
18 | |
19 | public SetVariableActionDescriptor(VariableUsage vu) { |
20 | vus = new ArrayList<VariableUsage>(); |
21 | vus.add(vu); |
22 | } |
23 | |
24 | @Override |
25 | public AbstractAction createAction() { |
26 | SetVariableAction action = SeffFactory.eINSTANCE.createSetVariableAction(); |
27 | action.setEntityName("ResultSetter"); |
28 | action.getLocalVariableUsages_SetVariableAction().addAll(this.getVariableUsages()); |
29 | return action; |
30 | } |
31 | |
32 | protected Collection<? extends VariableUsage> getVariableUsages() { |
33 | return this.vus; |
34 | } |
35 | } |