Class EventQueue
java.lang.Object
com.assemblyrobot.simulator.core.events.EventQueue
public class EventQueue
extends java.lang.Object
Generic event queue.
-
Constructor Summary
Constructors Constructor Description EventQueue()
-
Method Summary
Modifier and Type Method Description java.util.List<Event>
dump()
Dumps the event queue, in ascending order based on execution time.void
flush()
Empties the event queue.Event
peekNext()
Returns the nextEvent
to be executed.Event
pop()
Returns the nextEvent
to be executed, simultaneously removing it from the queue.void
print()
Prints the event queue to the terminal.void
schedule(@NonNull Event event)
Schedules anEvent
for future execution.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
EventQueue
public EventQueue()
-
-
Method Details
-
schedule
Schedules anEvent
for future execution.- Parameters:
event
- The event to schedule.
-
peekNext
Returns the nextEvent
to be executed.- Returns:
Event
-
pop
Returns the nextEvent
to be executed, simultaneously removing it from the queue.- Returns:
Event
-
dump
Dumps the event queue, in ascending order based on execution time.- Returns:
List
<Event
>
-
print
public void print()Prints the event queue to the terminal. -
flush
public void flush()Empties the event queue.
-