home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / JSL.ZIP / JSL20 / simula / simset / Linkage.java < prev   
Encoding:
Java Source  |  1998-02-20  |  1.4 KB  |  63 lines

  1.  
  2. package simula.simset;
  3.  
  4. /**
  5.  * The <code>Linkage</code> class is the abstract parent of any element of a
  6.  * double-linked list. It doesn't implement any content.
  7.  *
  8.  * @see Head
  9.  * @see Link
  10.  */
  11. public abstract class Linkage
  12. {
  13.   //--------------------------- VARIABLES ------------------------------
  14.   /**
  15.    * Predecessor in the list.
  16.    */
  17.   protected Linkage pred;
  18.  
  19.   /**
  20.    * Successor in the list.
  21.    */
  22.   protected Linkage suc;
  23.  
  24.  
  25.   //--------------------------- CONSTRUCTOR ------------------------------
  26.   /**
  27.    * Initialize this element with neither previous nor next element.
  28.    */
  29.   public Linkage()
  30.   {
  31.     pred = null;
  32.     suc = null;
  33.   }  
  34.   //--------------------------- METHODS ------------------------------
  35.   /**
  36.    * Returns the predecessor in the list. <code>Null</code> if absent.
  37.    * @return the predecessor in the list. <code>Null</code> if absent.
  38.    */
  39.   public Linkage pred() {
  40.     return pred;
  41.   }  
  42.   /**
  43.    * Sets the predecessor.
  44.    * @param _elem new predecessor to be set.
  45.    */
  46.   protected void pred(Linkage _elem) {
  47.     pred = _elem;
  48.   }  
  49.   /**
  50.    * Returns the successor in the list. <code>Null</code> if absent.
  51.    * @return the successor in the list. <code>Null</code> if absent.
  52.    */
  53.   public Linkage suc() {
  54.     return suc;
  55.   }  
  56.   /**
  57.    * Sets the successor.
  58.    * @param _elem new successor to be set.
  59.    */
  60.   protected void suc(Linkage _elem) {
  61.     suc = _elem;
  62.   }  
  63. }