|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--simulator.EventQueue
Module: simulator
Copyright: UMASS - MASL 1998
Description: The event "queue" is actually a hashtable of vectors, where each vector in the table is a collection of the events which will terminate, or take effect, during that descrete time interval. A hashtable was used to store these objects to facilitate a (possibly) sparse and dynamic temporally ordered range of objects.
| Inner classes inherited from class java.util.Map |
java.util.Map.Entry |
| Method Summary | |
void |
addEvent(Event e)
Adds an event to the correct slot |
boolean |
delayEvent(Event e,
int d)
Delays the start execution time of an event. |
boolean |
extendEvent(Event e,
int d)
Extends the execution time of an event. |
java.util.Vector |
fetchTimeSlot(int slotNum)
Fetches the time slot event vector, deleting from the table afterwards |
Event |
findEvent(long id)
Finds an event in the queue by its id number. |
int |
findOldestTimeSlot()
Finds the oldest time slot in the queue |
java.awt.Container |
getDisplay()
Returns the display |
static EventQueue |
getQueue()
Returns the global event queue |
java.util.Vector |
getTimeSlot(int slotNum)
Gets the time slot event vector |
boolean |
hasTimeSlot(int slotNum)
Used to tell if a time slot exists or not. |
void |
init()
Inits the queue |
boolean |
removeEvent(Event e)
Removes an element from the table |
void |
removeTimeSlot(int slotNum)
Removes a time slot |
void |
setDisplay(int slotNum)
Sets the display for a particular time slot |
| Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
public static EventQueue getQueue()
public void init()
public void addEvent(Event e)
e - The element to addpublic boolean removeEvent(Event e)
e - The element to removepublic Event findEvent(long id)
id - The id number to search for
public boolean extendEvent(Event e,
int d)
e - The element to removed - The time to extend it by
public boolean delayEvent(Event e,
int d)
e - The element to removed - The time to extend it bypublic int findOldestTimeSlot()
public boolean hasTimeSlot(int slotNum)
public java.util.Vector getTimeSlot(int slotNum)
slotNum - The slot to getpublic java.util.Vector fetchTimeSlot(int slotNum)
slotNum - The slot to fetchpublic void removeTimeSlot(int slotNum)
slotNum - The slot to removepublic java.awt.Container getDisplay()
public void setDisplay(int slotNum)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||