Returns the next event in the queue or ExternalEvent with time of double.MAX_VALUE if there are no events left @return The next event
()
| 109 | * @return The next event |
| 110 | */ |
| 111 | public ExternalEvent nextEvent() { |
| 112 | if (queue.size() == 0) { // no more events |
| 113 | return new ExternalEvent(Double.MAX_VALUE); |
| 114 | } |
| 115 | |
| 116 | ExternalEvent ee = queue.get(nextEventIndex); |
| 117 | nextEventIndex++; |
| 118 | |
| 119 | if (nextEventIndex >= queue.size()) { // ran out of events |
| 120 | queue = readEvents(nrofPreload); |
| 121 | nextEventIndex = 0; |
| 122 | } |
| 123 | |
| 124 | return ee; |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Returns the amount of events left in the buffer at the moment |
nothing calls this directly
no test coverage detected