1 | /** |
2 | * |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.stochasticexpressions; |
5 | |
6 | import de.uka.ipd.sdq.pcm.parameter.VariableCharacterisation; |
7 | import de.uka.ipd.sdq.pcm.parameter.VariableUsage; |
8 | import de.uka.ipd.sdq.pcm.parameter.util.ParameterSwitch; |
9 | |
10 | /** |
11 | * Pretty Print Paramters in a StoEx |
12 | * @author Steffen Becker |
13 | * |
14 | */ |
15 | public class ParameterPrettyPrint extends ParameterSwitch<String> { |
16 | |
17 | /** |
18 | * |
19 | */ |
20 | public ParameterPrettyPrint() { |
21 | } |
22 | |
23 | |
24 | /* (non-Javadoc) |
25 | * @see de.uka.ipd.sdq.pcm.parameter.util.ParameterSwitch#caseVariableUsage(de.uka.ipd.sdq.pcm.parameter.VariableUsage) |
26 | */ |
27 | @Override |
28 | public String caseVariableUsage(VariableUsage object) { |
29 | String result = ""; |
30 | if (object.getNamedReference__VariableUsage() != null) |
31 | result += doSwitch(object.getNamedReference__VariableUsage()); |
32 | else |
33 | result += "<not set yet>"; |
34 | if (object.getVariableCharacterisation_VariableUsage().size() > 0) |
35 | result += "." + doSwitch((VariableCharacterisation)object.getVariableCharacterisation_VariableUsage().get(0)); |
36 | else |
37 | result += ".<missing characterisation> = <missing expression>"; |
38 | return result; |
39 | } |
40 | |
41 | /* (non-Javadoc) |
42 | * @see de.uka.ipd.sdq.pcm.parameter.util.ParameterSwitch#caseVariableCharacterisation(de.uka.ipd.sdq.pcm.parameter.VariableCharacterisation) |
43 | */ |
44 | @Override |
45 | public String caseVariableCharacterisation(VariableCharacterisation object) { |
46 | String result = ""; |
47 | result += object.getType().getLiteral(); |
48 | result += " = " + object.getSpecification_VariableCharacterisation().getSpecification(); |
49 | return result; |
50 | } |
51 | } |