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.voidflush()Empties the event queue.EventpeekNext()Returns the nextEventto be executed.Eventpop()Returns the nextEventto be executed, simultaneously removing it from the queue.voidprint()Prints the event queue to the terminal.voidschedule(@NonNull Event event)Schedules anEventfor 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 anEventfor future execution.- Parameters:
event- The event to schedule.
-
peekNext
Returns the nextEventto be executed.- Returns:
Event
-
pop
Returns the nextEventto 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.
-