EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.codegen.simucontroller.dockmodel]

COVERAGE SUMMARY FOR SOURCE FILE [DockModel.java]

nameclass, %method, %block, %line, %
DockModel.java0%   (0/1)0%   (0/19)0%   (0/230)0%   (0/70)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DockModel0%   (0/1)0%   (0/19)0%   (0/230)0%   (0/70)
DockModel (SimulationDockService): void 0%   (0/1)0%   (0/5)0%   (0/2)
DockModel (SimulationDockService, String): void 0%   (0/1)0%   (0/34)0%   (0/12)
getID (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getMeasurementCount (): long 0%   (0/1)0%   (0/3)0%   (0/1)
getPercentDone (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getRemoteMaschineURI (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getService (): SimulationDockService 0%   (0/1)0%   (0/3)0%   (0/1)
getSimTime (): double 0%   (0/1)0%   (0/3)0%   (0/1)
isIdle (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
isRemote (): boolean 0%   (0/1)0%   (0/7)0%   (0/1)
isStepping (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
isSuspended (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
setIdle (boolean): void 0%   (0/1)0%   (0/34)0%   (0/10)
setIsStepping (boolean): void 0%   (0/1)0%   (0/25)0%   (0/7)
setIsSuspended (boolean): void 0%   (0/1)0%   (0/25)0%   (0/7)
setMeasurementCount (long): void 0%   (0/1)0%   (0/11)0%   (0/5)
setPercentDone (int): void 0%   (0/1)0%   (0/15)0%   (0/5)
setSimTime (double): void 0%   (0/1)0%   (0/21)0%   (0/5)
setStarted (boolean): void 0%   (0/1)0%   (0/26)0%   (0/7)

1package de.uka.ipd.sdq.codegen.simucontroller.dockmodel;
2 
3import java.io.Serializable;
4import java.util.Observable;
5 
6import de.uka.ipd.sdq.codegen.simucontroller.dockmodel.events.DockBusyEvent;
7import de.uka.ipd.sdq.codegen.simucontroller.dockmodel.events.DockIdleEvent;
8import de.uka.ipd.sdq.codegen.simucontroller.dockmodel.events.DockPerformedDebugStepEvent;
9import de.uka.ipd.sdq.codegen.simucontroller.dockmodel.events.DockResumedEvent;
10import de.uka.ipd.sdq.codegen.simucontroller.dockmodel.events.DockSimTimeChangedEvent;
11import de.uka.ipd.sdq.codegen.simucontroller.dockmodel.events.DockSimulationStartedEvent;
12import de.uka.ipd.sdq.codegen.simucontroller.dockmodel.events.DockSimulationTerminatedEvent;
13import de.uka.ipd.sdq.codegen.simucontroller.dockmodel.events.DockStartedDebugStepEvent;
14import de.uka.ipd.sdq.codegen.simucontroller.dockmodel.events.DockSuspendedEvent;
15import de.uka.ipd.sdq.simucomframework.simulationdock.SimulationDockService;
16 
17/**
18 * This class represents a single Simulation Dock's status. It fires events if the status of the dock changes.
19 * @author Steffen
20 *
21 */
22public class DockModel extends Observable implements Serializable
23{
24        /**
25         * 
26         */
27        private static final long serialVersionUID = -2378222579642029801L;
28        private int percentDone = 0;
29        private double simTime = 0;
30        private long measurementCount = 0;
31        private boolean idle = true;
32        private String id = null;
33        private String remoteMaschineURI;
34        private boolean isStepping = false;
35        private boolean isSuspended = false;
36        
37        private transient SimulationDockService service;
38        private boolean isStarted; 
39 
40        public DockModel(SimulationDockService service) {
41                this(service,null);
42        }
43        
44        public DockModel(SimulationDockService service, String remoteMaschineURI) {
45                this.service = service;
46                this.id = service.getDockId();
47                this.remoteMaschineURI = remoteMaschineURI;
48        }
49        
50        public int getPercentDone() {
51                return percentDone;
52        }
53        public double getSimTime() {
54                return simTime;
55        }
56        public long getMeasurementCount() {
57                return measurementCount;
58        }
59        public boolean isIdle() {
60                return idle;
61        }
62        
63        public void setPercentDone(int percentDone) {
64                if (!this.isIdle() && this.percentDone != percentDone) {
65                        this.percentDone = percentDone;
66                        setChanged();
67                        notifyObservers();
68                }
69        }
70 
71        public void setSimTime(double simTime) {
72                if (!this.isIdle() && this.simTime != simTime) {
73                        this.simTime = simTime;
74                        setChanged();
75                        notifyObservers(new DockSimTimeChangedEvent(this,simTime));
76                }
77        }
78        
79        public void setMeasurementCount(long measurementCount) {
80                if (!this.isIdle()) {
81                        this.measurementCount = measurementCount;
82                        setChanged();
83                        notifyObservers();
84                }
85        }
86        
87        public void setIdle(boolean idle) {
88                if (this.idle != idle) {
89                        this.idle = idle;
90                        this.measurementCount = 0;
91                        this.simTime = 0;
92                        this.percentDone = 0;
93                        setChanged();
94                        if (idle) 
95                                notifyObservers(new DockIdleEvent(this));
96                        else
97                                notifyObservers(new DockBusyEvent(this));
98                }
99        }
100        
101        public String getID() {
102                return id;
103        }
104 
105        public SimulationDockService getService() {
106                return service;
107        }
108 
109        public boolean isRemote() {
110                return remoteMaschineURI != null;
111        }
112 
113        public String getRemoteMaschineURI() {
114                return remoteMaschineURI;
115        }
116 
117        public boolean isStepping() {
118                return isStepping;
119        }
120 
121        public void setIsStepping(boolean isStepping) {
122                if (this.isStepping != isStepping) {
123                        this.isStepping = isStepping;
124                        setChanged();
125                        if (isStepping)
126                                notifyObservers(new DockStartedDebugStepEvent(this));
127                        else
128                                notifyObservers(new DockPerformedDebugStepEvent(this));
129                }
130        }
131 
132        public boolean isSuspended() {
133                return isSuspended;
134        }
135 
136        public void setIsSuspended(boolean isSuspended) {
137                if (this.isSuspended != isSuspended) {
138                        this.isSuspended = isSuspended;
139                        setChanged();
140                        if (isSuspended)
141                                notifyObservers(new DockSuspendedEvent(this));
142                        else
143                                notifyObservers(new DockResumedEvent(this));
144                }
145        }
146 
147        public void setStarted(boolean started) {
148                if (this.isStarted != started) {
149                        this.isStarted = started;
150                        setChanged();
151                        if (isStarted)
152                                notifyObservers(new DockSimulationStartedEvent(this));
153                        else
154                                notifyObservers(new DockSimulationTerminatedEvent(this));
155                }
156        }
157        
158}

[all classes][de.uka.ipd.sdq.codegen.simucontroller.dockmodel]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov