Class TimingEventQueue
java.lang.Object
simEngine.TimingEventQueue
- All Implemented Interfaces:
Iterable<SimEvent>, 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds an event to the queuevoidclear()Clears this queue, removing all pointersiterator()Returns an iterator that iterates over this queue elements in no special order.peek()Method peek.pop()Method pop.booleanRemoves given eventvoidsetEngine(RandomEngine engine) intsize()Method size.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
TimingEventQueue
public TimingEventQueue()
-
-
Method Details
-
size
public int size()Description copied from interface:EventQueueMethod size.- Specified by:
sizein interfaceEventQueue- Returns:
- the number of events in this queue
-
add
Description copied from interface:EventQueueAdds an event to the queue- Specified by:
addin interfaceEventQueue- Parameters:
event- the event to add- Returns:
- true if element was added, false otherwise.
-
pop
Description copied from interface:EventQueueMethod pop.- Specified by:
popin interfaceEventQueue- Returns:
- the first event of the queue, removing it from the queue
-
peek
Description copied from interface:EventQueueMethod peek.- Specified by:
peekin interfaceEventQueue- Returns:
- the first event of the queue, without removing it
-
remove
Description copied from interface:EventQueueRemoves given event- Specified by:
removein interfaceEventQueue- Parameters:
event- the event to remove- Returns:
- true if event was found, false otherwise
-
clear
public void clear()Description copied from interface:EventQueueClears this queue, removing all pointers- Specified by:
clearin interfaceEventQueue
-
iterator
Description copied from interface:EventQueueReturns an iterator that iterates over this queue elements in no special order. Iterator must implement remove() method.- Specified by:
iteratorin interfaceEventQueue- Specified by:
iteratorin interfaceIterable<SimEvent>- Returns:
- an iterator with no special order.
-
setEngine
-