Package jmri

Class TransitSection

java.lang.Object
jmri.TransitSection

public class TransitSection
extends Object
This class holds information and options for a Section when assigned to a Transit. Corresponds to an allocatable "Section" of track assigned to a Transit.

A TransitSection holds the following information: Section ID Section Direction Sequence number of Section within the Transit Special actions list for train in this Section, if requested (see TransitSectionAction.java) Whether this Section is a primary section or an alternate section

A TransitSection is referenced via a list in its parent Transit, and is stored on disk when its parent Transit is stored.

Provides for delayed initializatio of Section when loading panel files, so that this is not dependent on order of items in the panel file.

  • Field Details

  • Constructor Details

    • TransitSection

      public TransitSection​(Section s, int seq, int direction)
      Create a TransitSection. This calls the alternate constructor with false for the alt value.
      Parameters:
      s - the section to add to the transit
      seq - the sequence number of the section in the transit
      direction - the direction of travel within the transit
    • TransitSection

      public TransitSection​(Section s, int seq, int direction, boolean alt)
      Create an alternate or primary TransitSection.
      Parameters:
      s - the section to add to the transit
      seq - the sequence number of the section in the transit
      direction - the direction of travel within the transit
      alt - true if the section is an alternate; false if section is primary or has no alternates
    • TransitSection

      public TransitSection​(Section s, int seq, int direction, boolean alt, boolean safe, String stopAllocatingSensorName)
      Create an alternate or primary TransitSection, and defined as safe or not
      Parameters:
      s - the section to add to the transit
      seq - the sequence number of the section in the transit
      direction - the direction of travel within the transit
      alt - true if the section is an alternate; false if section is primary or has no alternates
      safe - true if this is a safe section. When dispatcher by safe sections a train is dispatched safe section to safe section with all intervening sections available.
      stopAllocatingSensorName - If this sensor is present, valid, and Active allocation will stop until it is no longer Active.
    • TransitSection

      public TransitSection​(String secName, int seq, int direction, boolean alt)
      Create an alternate or primary TransitSection with a delayed initialization.
      Parameters:
      secName - the name of the section to add to the transit
      seq - the sequence number of the section in the transit
      direction - the direction of travel within the transit
      alt - true if the section is an alternate; false if section is primary or has no alternates
    • TransitSection

      public TransitSection​(String secName, int seq, int direction, boolean alt, boolean safe, String stopAllocatingSensorName)
      Create an alternate or primary TransitSection with a delayed initialization.
      Parameters:
      secName - the name of the section to add to the transit
      seq - the sequence number of the section in the transit
      direction - the direction of travel within the transit
      alt - true if the section is an alternate; false if section is primary or has no alternates
      safe - true if this is a safe section. When dispatcher by safe sections a train is dispatched safe section to safe section with all intervening sections available.
      stopAllocatingSensorName - If this sensor is present, valid, and Active allocation will stop until it is no longer Active.
  • Method Details