MCPcopy Create free account
hub / github.com/akeranen/the-one / nextEvent

Method nextEvent

input/ExternalEventsQueue.java:111–125  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

readEventsMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected