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 next Event to be executed.
    Event pop()
    Returns the next Event to be executed, simultaneously removing it from the queue.
    void print()
    Prints the event queue to the terminal.
    void schedule​(@NonNull Event event)
    Schedules an Event 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

      public void schedule​(@NonNull @NonNull Event event)
      Schedules an Event for future execution.
      Parameters:
      event - The event to schedule.
    • peekNext

      public Event peekNext()
      Returns the next Event to be executed.
      Returns:
      Event
    • pop

      public Event pop()
      Returns the next Event to be executed, simultaneously removing it from the queue.
      Returns:
      Event
    • dump

      public java.util.List<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.