Interface EventQueue

All Known Implementing Classes:
DeferredQueue, FutureQueue

public interface EventQueue
An interface to be implemented by event queues.
Since:
CloudSim Plus 1.0
Author:
Marcos Dias de Assuncao, Manoel Campos da Silva Filho
  • Method Summary

    Modifier and Type Method Description
    void addEvent​(SimEvent newEvent)
    Adds a new event to the queue.
    SimEvent first()
    Gets the first element of the queue.
    boolean isEmpty()
    Checks if the queue is empty.
    Iterator<SimEvent> iterator()
    Returns an iterator to the elements into the queue.
    int size()
    Returns the size of this event queue.
    Stream<SimEvent> stream()
    Returns a stream to the elements into the queue.
  • Method Details

    • addEvent

      void addEvent​(SimEvent newEvent)
      Adds a new event to the queue. Adding a new event to the queue preserves the temporal order of the events in the queue.
      Parameters:
      newEvent - The event to be put in the queue.
    • iterator

      Iterator<SimEvent> iterator()
      Returns an iterator to the elements into the queue.
      Returns:
      the iterator
    • stream

      Stream<SimEvent> stream()
      Returns a stream to the elements into the queue.
      Returns:
      the stream
    • size

      int size()
      Returns the size of this event queue.
      Returns:
      the size
    • isEmpty

      boolean isEmpty()
      Checks if the queue is empty.
      Returns:
      true if the queue is empty, false otherwise
    • first

      Gets the first element of the queue.
      Returns:
      the first element
      Throws:
      NoSuchElementException - when the queue is empty