|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cz.zcu.fav.kiv.jsim.JSimCalendar
The JSimCalendar class holds information about all scheduled events within a J-Sim simulation. It contains a list of JSimCalendarEvent elements, ordered by their simulation time. J-Sim simulations use this class to schedule processes and to get information about a process which should be run during the next simulation step. You should never need to create an instance of this class.
Field Summary | |
private java.util.LinkedList |
eventList
This list holds all events of the calendar. |
static double |
NEVER
Constant signalling that there is no process scheduled. |
static JSimProcess |
NOBODY
Constant signalling that there is no process scheduled. |
Constructor Summary | |
JSimCalendar()
Creates a new empty calendar. |
Method Summary | |
void |
addEntry(double absTime,
JSimProcess process)
Adds a new event with the specified time and the specified process to the calendar. |
void |
addWholeEvent(JSimCalendarEvent calendarEvent)
Adds the specified event to the calendar. |
int |
deleteEntries(JSimProcess process,
boolean all)
Deletes one or all events of a process from the calendar. |
JSimProcess |
getFirstProcess()
Returns the first scheduled process. |
double |
getFirstProcessTime()
Returns the time of the event being at the head of the calendar. |
java.util.ListIterator |
getIterator()
Returns an iterator over all events in the calendar. |
boolean |
isEmpty()
Says whether the calendar is empty. |
void |
jump()
Deletes the event at the head of the calendar and sets the head to the event which follows the current head. |
java.lang.String |
toString()
Returns a string representation of the calendar. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final JSimProcess NOBODY
public static final double NEVER
private java.util.LinkedList eventList
Constructor Detail |
public JSimCalendar()
Method Detail |
public void addEntry(double absTime, JSimProcess process) throws JSimInvalidParametersException
absTime
- The absolute simulation time of the event.process
- The process to be later activated.
JSimInvalidParametersException
- This exception is thrown out if the absolute simulation
time is negative or the process is not specified (null).public void addWholeEvent(JSimCalendarEvent calendarEvent) throws JSimInvalidParametersException
calendarEvent
- The event to be added to the calendar.
JSimInvalidParametersException
- This exception is thrown out if the absolute simulation
time is negative or the process is not specified (null).public int deleteEntries(JSimProcess process, boolean all) throws JSimInvalidParametersException
process
- The process whose event(s) are to be deleted.all
- A flag saying that not only one but all events of the given process should be deleted.
JSimInvalidParametersException
- This exception is thrown out if the process is
not specified (null).public JSimProcess getFirstProcess()
public double getFirstProcessTime()
public void jump()
public boolean isEmpty()
public java.util.ListIterator getIterator()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |