home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / JSL.ZIP / JSL20 / simula / simset / simulation / EventThread.java < prev    next >
Encoding:
Java Source  |  1998-02-20  |  1.5 KB  |  56 lines

  1.  
  2. package simula.simset.simulation;
  3.  
  4. /**
  5.  * The EventThread class implements a double-linked list of process threads.
  6.  * @see Process
  7.  * @see Thread
  8.  */
  9. class EventThread extends Thread {
  10.  
  11.   private Process eventProcess;
  12.   private EventThread nextThread;
  13.   private EventThread prevThread;
  14.  
  15.  
  16.  
  17.     // Constructor
  18.     /**
  19.      * Couple the new element of the list with the given process.
  20.      * @param _process The process to be inserted in the list.
  21.      * $param _sim The active simulation.
  22.      */
  23.     public EventThread(Process _process, simula.simset.simulation.Simulation _sim) {
  24.         //super(_sim.processes,_process);
  25.         super(_process);
  26.         //System.err.println("Adding new process") ;
  27.         
  28.         eventProcess = _process;
  29.         nextThread = null;
  30.         prevThread = null;
  31.     }
  32.     // Accessors
  33.     /**
  34.      * Returns the process associated with this element.
  35.      * @return the process associated with this element.
  36.      */
  37.     protected Process eventProcess() { return eventProcess; }
  38.     /**
  39.      * Returns the next element of the list.
  40.      * @return the next element of the list.
  41.      */
  42.     protected EventThread nextThread() { return nextThread; }
  43.     /**
  44.      * Sets the next element of the list.
  45.      */
  46.     protected void nextThread(EventThread _EThread) { nextThread = _EThread; }
  47.     /**
  48.      * Returns the previous element of the list.
  49.      * @return the previous element of the list.
  50.      */
  51.     protected EventThread prevThread() { return prevThread; }
  52.     /**
  53.      * Sets the previous element of the list.
  54.      */
  55.     protected void prevThread(EventThread _EThread) { prevThread = _EThread; }
  56. }