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 Summary
Fields Modifier and Type Field Description (package private) boolean
temporary
-
Constructor Summary
Constructors Constructor Description TransitSection(String secName, int seq, int direction, boolean alt)
Create an alternate or primary TransitSection with a delayed initialization.TransitSection(String secName, int seq, int direction, boolean alt, boolean safe, String stopAllocatingSensorName)
Create an alternate or primary TransitSection with a delayed initialization.TransitSection(Section s, int seq, int direction)
Create a TransitSection.TransitSection(Section s, int seq, int direction, boolean alt)
Create an alternate or primary TransitSection.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 -
Method Summary
Modifier and Type Method Description void
addAction(TransitSectionAction act)
int
getDirection()
Section
getSection()
Get the associated section.String
getSectionName()
int
getSequenceNumber()
String
getStopAllocatingSensor()
ArrayList<TransitSectionAction>
getTransitSectionActionList()
Get a list of the actions for this TransitSectionboolean
isAlternate()
boolean
isSafe()
boolean
isTemporary()
void
setAlternate(boolean alt)
void
setSafe(boolean safe)
void
setStopAllocatingSensor(String stopAllocatingSensor)
void
setTemporary(boolean boo)
-
Field Details
-
Constructor Details
-
TransitSection
Create a TransitSection. This calls the alternate constructor with false for the alt value.- Parameters:
s
- the section to add to the transitseq
- the sequence number of the section in the transitdirection
- the direction of travel within the transit
-
TransitSection
Create an alternate or primary TransitSection.- Parameters:
s
- the section to add to the transitseq
- the sequence number of the section in the transitdirection
- the direction of travel within the transitalt
- 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 transitseq
- the sequence number of the section in the transitdirection
- the direction of travel within the transitalt
- true if the section is an alternate; false if section is primary or has no alternatessafe
- 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
Create an alternate or primary TransitSection with a delayed initialization.- Parameters:
secName
- the name of the section to add to the transitseq
- the sequence number of the section in the transitdirection
- the direction of travel within the transitalt
- 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 transitseq
- the sequence number of the section in the transitdirection
- the direction of travel within the transitalt
- true if the section is an alternate; false if section is primary or has no alternatessafe
- 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
-
setTemporary
-
isTemporary
-
getSection
Get the associated section.- Returns:
- the section or null if no section is associated with this TransitSection
-
getSectionName
-
getDirection
-
getSequenceNumber
-
addAction
-
isAlternate
-
setAlternate
-
isSafe
-
setSafe
-
getStopAllocatingSensor
-
setStopAllocatingSensor
-
getTransitSectionActionList
Get a list of the actions for this TransitSection- Returns:
- a list of actions or an empty list if there are no actions
-