Class TimingEventQueue

java.lang.Object
simEngine.TimingEventQueue
All Implemented Interfaces:
Iterable<SimEvent>, EventQueue

public class TimingEventQueue extends Object implements EventQueue

Title: Timing Event Queue

Description: This class implements the timing event queue.

Author:
Lulai Zhu Date: 10-09-2016 Time: 14.00.00
  • Constructor Details

    • TimingEventQueue

      public TimingEventQueue()
  • Method Details

    • size

      public int size()
      Description copied from interface: EventQueue
      Method size.
      Specified by:
      size in interface EventQueue
      Returns:
      the number of events in this queue
    • add

      public boolean add(SimEvent event)
      Description copied from interface: EventQueue
      Adds an event to the queue
      Specified by:
      add in interface EventQueue
      Parameters:
      event - the event to add
      Returns:
      true if element was added, false otherwise.
    • pop

      public SimEvent pop()
      Description copied from interface: EventQueue
      Method pop.
      Specified by:
      pop in interface EventQueue
      Returns:
      the first event of the queue, removing it from the queue
    • peek

      public SimEvent peek()
      Description copied from interface: EventQueue
      Method peek.
      Specified by:
      peek in interface EventQueue
      Returns:
      the first event of the queue, without removing it
    • remove

      public boolean remove(SimEvent event)
      Description copied from interface: EventQueue
      Removes given event
      Specified by:
      remove in interface EventQueue
      Parameters:
      event - the event to remove
      Returns:
      true if event was found, false otherwise
    • clear

      public void clear()
      Description copied from interface: EventQueue
      Clears this queue, removing all pointers
      Specified by:
      clear in interface EventQueue
    • iterator

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

      public void setEngine(RandomEngine engine)