Module Simula

Class RTS_Link

All Implemented Interfaces:
Runnable
Direct Known Subclasses:
RTS_Process, RTS_ShapeElement, RTS_TextElement

public class RTS_Link extends RTS_Linkage
System class Link.
  linkage class link;
          begin
             procedure out;
             if SUC=/=none then begin
                SUC.PRED :- PRED;
                PRED.SUC :- SUC;
                SUC      :- PRED :- none
             end out;
 
             procedure follow(ptr); ref (linkage) ptr;
             begin  out;
                if ptr=/=none and then ptr.SUC=/=none then begin
                   PRED     :- ptr;
                   SUC      :- ptr.SUC;
                   SUC.PRED :- ptr.SUC :- this linkage  end
             end follow;
 
             procedure precede(ptr); ref (linkage) ptr;
             begin  out;
                if ptr=/=none and then ptr.SUC=/=none then begin
                   SUC      :- ptr;
                   PRED     :- ptr.PRED;
                   PRED.SUC :- ptr.PRED :- this linkage end if
             end precede;
 
             procedure into(S); ref (head) S;  precede(S);
 
          end link;
 
Objects belonging to subclasses of the class "link" may acquire set membership. An object may only be a member of one set at a given instant.

In addition to the procedures "suc" and "pred", there are four procedures associated with each "link" object: "out", "follow", "precede" and "into".

Link to GitHub: Source File.

Author:
SIMULA Standards Group, Øystein Myhre Andersen
  • Constructor Details

    • RTS_Link

      public RTS_Link(RTS_RTObject SL)
      Create a new _Link.
      Parameters:
      SL - staticLink
  • Method Details

    • _STM

      public RTS_Link _STM()
      Description copied from class: RTS_RTObject
      Method representing the Statements in this Block
      This method is virtual and must be redefined in blocks.
      Overrides:
      _STM in class RTS_Linkage
      Returns:
      a pointer to this _RTObject
    • out

      public void out()
      Procedure out.

      The procedure "out" removes the object from the set (if any) of which it is a member. The procedure call has no effect if the object has no set membership.

    • follow

      public void follow(RTS_Linkage x)
      Procedure follow.

      The procedure "follow" remove the object from the set (if any) of which it is a member and insert it in a set at a given position. The set and the position are indicated by a parameter which is inner to "linkage". The procedure call has the same effect as "out" (except for possible side effects from evaluation of the parameter) if the parameter is none or if it has no set membership and is not a set head. Otherwise the object is inserted immediately after the "linkage" object designated by the parameter.

      Parameters:
      x - argument x
    • precede

      public void precede(RTS_Linkage x)
      Procedure precede.

      The procedure "precede" remove the object from the set (if any) of which it is a member and insert it in a set at a given position. The set and the position are indicated by a parameter which is inner to "linkage". The procedure call has the same effect as "out" (except for possible side effects from evaluation of the parameter) if the parameter is none or if it has no set membership and is not a set head. Otherwise the object is inserted immediately before the "linkage" object designated by the parameter.

      Parameters:
      x - argument x
    • into

      public void into(RTS_Head S)
      Procedure into.

      The procedure "into" removes the object from the set (if any) of which it is a member and inserts it as the last member of the set designated by the parameter. The procedure call has the same effect as "out" if the parameter has the value none (except for possible side effects from evaluating the actual parameter).

      Parameters:
      S - The set(Head) to receive this Link.