All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class simula.simset.Link

java.lang.Object
   |
   +----simula.simset.Linkage
           |
           +----simula.simset.Link

public class Link
extends Linkage
This class implements the elementary object in a double linked list.

See Also:
Linkage, Head

Variable Index

 o list
This is a reference to the list which this object belongs to.

Constructor Index

 o Link()
The new object doesn't belong to any list.

Method Index

 o follow(Linkage)
This has a similar action to precede, except that this method inserts this object after the parameter if this is a Link object, otherwise places it as the first object in the given list.
 o into(Head)
If _list refers to an existing linked list, this method appends the object at the end of that list; otherwise it is removed from any previous list it might have belonged to.
 o list()
Returns the list which this object belongs to.
 o out()
If this object belongs to a linked list (it cannot belong to more than one list), this method removes it from that list; otherwise it has no effect.
 o precede(Linkage)
The actual parameter of this procedure may be either a Link object or a Head object: if _elem is a Link object, this method inserts this object into the same linked list that _elem belongs to, in the position immediately preceding _elem (if _elem does not belong to a linked list, the result is the same as for out; if _elem is a Head object, this method is equivalent to into.

Variables

 o list
 protected Head list
This is a reference to the list which this object belongs to.

Constructors

 o Link
 public Link()
The new object doesn't belong to any list.

Methods

 o follow
 public void follow(Linkage _elem) throws SimulaException
This has a similar action to precede, except that this method inserts this object after the parameter if this is a Link object, otherwise places it as the first object in the given list.

Parameters:
_elem - the element to be followed by this object.
Throws: SimulaException
The argument is Null or belongs to a Null list.
See Also:
Head
 o into
 public void into(Head _list) throws SimulaException
If _list refers to an existing linked list, this method appends the object at the end of that list; otherwise it is removed from any previous list it might have belonged to.

Parameters:
_list - the list where this object will be appended.
Throws: SimulaException
An error happened attempting to append this object to the list.
See Also:
follow
 o list
 protected Head list()
Returns the list which this object belongs to.

Returns:
the list which this object belongs to.
 o out
 public void out()
If this object belongs to a linked list (it cannot belong to more than one list), this method removes it from that list; otherwise it has no effect.

 o precede
 public void precede(Linkage _elem) throws SimulaException
The actual parameter of this procedure may be either a Link object or a Head object: if _elem is a Link object, this method inserts this object into the same linked list that _elem belongs to, in the position immediately preceding _elem (if _elem does not belong to a linked list, the result is the same as for out; if _elem is a Head object, this method is equivalent to into.

Parameters:
_elem - the element to be preceded by this object.
Throws: SimulaException
The argument is Null or belongs to a Null list.
See Also:
Head

All Packages  Class Hierarchy  This Package  Previous  Next  Index