| 100 | } |
| 101 | } |
| 102 | public class Restart extends Event { |
| 103 | private Event[] eventList; |
| 104 | public |
| 105 | Restart(long delayTime, Event[] eventList) { |
| 106 | super(delayTime); |
| 107 | this.eventList = eventList; |
| 108 | for(Event e : eventList) |
| 109 | addEvent(e); |
| 110 | } |
| 111 | @Override public void action() { |
| 112 | for(Event e : eventList) { |
| 113 | e.start(); // Rerun each event |
| 114 | addEvent(e); |
| 115 | } |
| 116 | start(); // Rerun this Event |
| 117 | addEvent(this); |
| 118 | } |
| 119 | @Override public String toString() { |
| 120 | return "Restarting system"; |
| 121 | } |
| 122 | } |
| 123 | public static class Terminate extends Event { |
| 124 | public Terminate(long delayTime) { |
| 125 | super(delayTime); |
nothing calls this directly
no outgoing calls
no test coverage detected