1 | package de.uka.ipd.sdq.dsexplore.helper; |
2 | |
3 | import de.uka.ipd.sdq.pcm.core.entity.Entity; |
4 | import de.uka.ipd.sdq.pcm.designdecision.DegreeOfFreedomInstance; |
5 | import de.uka.ipd.sdq.pcm.designdecision.ProcessingResourceDegree; |
6 | |
7 | public class DegreeOfFreedomHelper { |
8 | |
9 | public static String getDegreeDescription(DegreeOfFreedomInstance decision) { |
10 | String suffix = ""; |
11 | if (decision instanceof ProcessingResourceDegree){ |
12 | suffix = ":"+((ProcessingResourceDegree)decision).getProcessingresourcetype().getEntityName(); |
13 | } |
14 | |
15 | String primaryChangeableName = decision.getPrimaryChanged().toString(); |
16 | if (decision.getPrimaryChanged() instanceof Entity){ |
17 | primaryChangeableName = ((Entity)decision.getPrimaryChanged()).getEntityName(); |
18 | } |
19 | |
20 | return decision.getClass().getSimpleName() + ":" + primaryChangeableName + suffix; |
21 | } |
22 | |
23 | } |