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

COVERAGE SUMMARY FOR SOURCE FILE [DesmoJSimEvent.java]

nameclass, %method, %block, %line, %
DesmoJSimEvent.java0%   (0/1)0%   (0/5)0%   (0/40)0%   (0/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DesmoJSimEvent0%   (0/1)0%   (0/5)0%   (0/40)0%   (0/13)
DesmoJSimEvent (AbstractSimEventDelegator, DesmoJModel, String): void 0%   (0/1)0%   (0/9)0%   (0/3)
eventRoutine (DesmoJEntity): void 0%   (0/1)0%   (0/6)0%   (0/2)
removeEvent (): void 0%   (0/1)0%   (0/6)0%   (0/3)
schedule (IEntity, double): void 0%   (0/1)0%   (0/15)0%   (0/4)
scheduledAtTime (): double 0%   (0/1)0%   (0/4)0%   (0/1)

1package de.uka.ipd.sdq.simulation.abstractsimengine.desmoj;
2 
3import de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEntityDelegator;
4import de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEventDelegator;
5import de.uka.ipd.sdq.simulation.abstractsimengine.IEntity;
6import de.uka.ipd.sdq.simulation.abstractsimengine.ISimEvent;
7import desmoj.core.simulator.Event;
8import desmoj.core.simulator.TimeSpan;
9 
10/**
11 * @author Steffen Becker
12 * @author Philipp Merkle
13 */
14public class DesmoJSimEvent<E extends IEntity> extends Event<DesmoJEntity> implements
15        ISimEvent<E> {
16 
17    private final AbstractSimEventDelegator<E> event;
18 
19    public DesmoJSimEvent(final AbstractSimEventDelegator<E> event, final DesmoJModel owner, final String name) {
20        super(owner, name, false);
21        this.event = event;
22    }
23 
24    /**
25     * The event handler, which is called by DESMO-J when an event occurred.
26     * <p>
27     * {@inheritDoc}
28     * 
29     * @see Event#eventRoutine(desmoj.core.simulator.Entity)
30     */
31    @SuppressWarnings("unchecked")
32    @Override
33    public void eventRoutine(final DesmoJEntity who) {
34        // delegate the event handling to the encapsulated event
35        this.event.eventRoutine((E) who.getEncapsulatedEntity());
36    }
37 
38    @Override
39    public void schedule(final E entity, final double delay) {
40        final AbstractSimEntityDelegator simEntity = (AbstractSimEntityDelegator) entity;
41        final DesmoJEntity desmoJEntity = (DesmoJEntity) simEntity.getEncapsulatedEntity();
42        this.schedule(desmoJEntity, new TimeSpan(delay));
43    }
44 
45    @Override
46    public void removeEvent() {
47        if (this.isScheduled()) {
48            this.cancel();
49        }
50    }
51 
52    @Override
53    public double scheduledAtTime() {
54        return this.scheduledAt().getTimeAsDouble();
55    }
56    
57}

[all classes][de.uka.ipd.sdq.simulation.abstractsimengine.desmoj]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov