1 | /** |
2 | * |
3 | */ |
4 | package de.uka.ipd.sdq.codegen.simucontroller.debug; |
5 | |
6 | import de.uka.ipd.sdq.simucomframework.simucomstatus.WaitForAcquire; |
7 | import de.uka.ipd.sdq.simucomframework.simucomstatus.WaitForDelay; |
8 | import de.uka.ipd.sdq.simucomframework.simucomstatus.WaitForDemand; |
9 | import de.uka.ipd.sdq.simucomframework.simucomstatus.util.SimucomstatusSwitch; |
10 | |
11 | /** |
12 | * @author Snowball |
13 | * |
14 | */ |
15 | public class ProcessActionPrintVisitor extends SimucomstatusSwitch<String> { |
16 | |
17 | /** |
18 | * |
19 | */ |
20 | public ProcessActionPrintVisitor() { |
21 | } |
22 | |
23 | /* (non-Javadoc) |
24 | * @see de.uka.ipd.sdq.simucomframework.simucomstatus.util.SimucomstatusSwitch#caseWaitForAcquire(de.uka.ipd.sdq.simucomframework.simucomstatus.WaitForAcquire) |
25 | */ |
26 | @Override |
27 | public String caseWaitForAcquire(WaitForAcquire object) { |
28 | // object.getResource() == null can happen during simulation startup |
29 | return "Waiting to Acquire Resource "+(object.getResource() == null ? "N/A" : object.getResource().getId()); |
30 | } |
31 | |
32 | /* (non-Javadoc) |
33 | * @see de.uka.ipd.sdq.simucomframework.simucomstatus.util.SimucomstatusSwitch#caseWaitForDelay(de.uka.ipd.sdq.simucomframework.simucomstatus.WaitForDelay) |
34 | */ |
35 | @Override |
36 | public String caseWaitForDelay(WaitForDelay object) { |
37 | return "Holding execution for "+object.getDelay(); |
38 | } |
39 | |
40 | /* (non-Javadoc) |
41 | * @see de.uka.ipd.sdq.simucomframework.simucomstatus.util.SimucomstatusSwitch#caseWaitForDemand(de.uka.ipd.sdq.simucomframework.simucomstatus.WaitForDemand) |
42 | */ |
43 | @Override |
44 | public String caseWaitForDemand(WaitForDemand object) { |
45 | return "Waiting for ActiveResource "+object.getResource().getId()+" to process "+object.getDemand(); |
46 | } |
47 | |
48 | |
49 | |
50 | } |