Interface EventQueue

All Superinterfaces:
Iterable<SimEvent>
All Known Implementing Classes:
CircularEventQueue, HybridEventQueue, ListEventQueue, TimingEventQueue

public interface EventQueue extends Iterable<SimEvent>

Name: EventQueue

Description: Event Queue specifies a queue of SimEvent objects sorted by time and insertion order. This class holds all simulation events, thus its performances impact dramatically the simulation.

Date: 12/mag/2009 Time: 08:02:18

Version:
1.0
Author:
Bertoli Marco
  • Method Details

    • size

      int size()
      Method size.
      Returns:
      the number of events in this queue
    • add

      boolean add(SimEvent event)
      Adds an event to the queue
      Parameters:
      event - the event to add
      Returns:
      true if element was added, false otherwise.
    • pop

      SimEvent pop()
      Method pop.
      Returns:
      the first event of the queue, removing it from the queue
    • peek

      SimEvent peek()
      Method peek.
      Returns:
      the first event of the queue, without removing it
    • remove

      boolean remove(SimEvent ev)
      Removes given event
      Parameters:
      ev - the event to remove
      Returns:
      true if event was found, false otherwise
    • clear

      void clear()
      Clears this queue, removing all pointers
    • iterator

      Iterator<SimEvent> iterator()
      Returns an iterator that iterates over this queue elements in no special order. Iterator must implement remove() method.
      Specified by:
      iterator in interface Iterable<SimEvent>
      Returns:
      an iterator with no special order.