home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-02-20 | 1.5 KB | 56 lines |
-
- package simula.simset.simulation;
-
- /**
- * The EventThread class implements a double-linked list of process threads.
- * @see Process
- * @see Thread
- */
- class EventThread extends Thread {
-
- private Process eventProcess;
- private EventThread nextThread;
- private EventThread prevThread;
-
-
-
- // Constructor
- /**
- * Couple the new element of the list with the given process.
- * @param _process The process to be inserted in the list.
- * $param _sim The active simulation.
- */
- public EventThread(Process _process, simula.simset.simulation.Simulation _sim) {
- //super(_sim.processes,_process);
- super(_process);
- //System.err.println("Adding new process") ;
-
- eventProcess = _process;
- nextThread = null;
- prevThread = null;
- }
- // Accessors
- /**
- * Returns the process associated with this element.
- * @return the process associated with this element.
- */
- protected Process eventProcess() { return eventProcess; }
- /**
- * Returns the next element of the list.
- * @return the next element of the list.
- */
- protected EventThread nextThread() { return nextThread; }
- /**
- * Sets the next element of the list.
- */
- protected void nextThread(EventThread _EThread) { nextThread = _EThread; }
- /**
- * Returns the previous element of the list.
- * @return the previous element of the list.
- */
- protected EventThread prevThread() { return prevThread; }
- /**
- * Sets the previous element of the list.
- */
- protected void prevThread(EventThread _EThread) { prevThread = _EThread; }
- }