home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-02-20 | 1.4 KB | 63 lines |
-
- package simula.simset;
-
- /**
- * The <code>Linkage</code> class is the abstract parent of any element of a
- * double-linked list. It doesn't implement any content.
- *
- * @see Head
- * @see Link
- */
- public abstract class Linkage
- {
- //--------------------------- VARIABLES ------------------------------
- /**
- * Predecessor in the list.
- */
- protected Linkage pred;
-
- /**
- * Successor in the list.
- */
- protected Linkage suc;
-
-
- //--------------------------- CONSTRUCTOR ------------------------------
- /**
- * Initialize this element with neither previous nor next element.
- */
- public Linkage()
- {
- pred = null;
- suc = null;
- }
- //--------------------------- METHODS ------------------------------
- /**
- * Returns the predecessor in the list. <code>Null</code> if absent.
- * @return the predecessor in the list. <code>Null</code> if absent.
- */
- public Linkage pred() {
- return pred;
- }
- /**
- * Sets the predecessor.
- * @param _elem new predecessor to be set.
- */
- protected void pred(Linkage _elem) {
- pred = _elem;
- }
- /**
- * Returns the successor in the list. <code>Null</code> if absent.
- * @return the successor in the list. <code>Null</code> if absent.
- */
- public Linkage suc() {
- return suc;
- }
- /**
- * Sets the successor.
- * @param _elem new successor to be set.
- */
- protected void suc(Linkage _elem) {
- suc = _elem;
- }
- }