jmri
Class TransitSection

java.lang.Object
  extended by 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.

An TransitSection holds the following information: Section ID Section Direction Sequence number of Section within the Transit Special action for train in this Section, if requested Data for special action, if needed 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.

Two Special Actions are currently defines, but more may be added Pause for a user set number of fast clock minutes after reaching the end of the assigned section. Wait after reaching the end of the assigned section until an external restart occurs.

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

Author:
Dave Duchamp Copyright (C) 2008

Field Summary
static int NONE
          Constants representing the Special Action requested for this Section
static int PAUSE
           
static int WAIT
           
 
Constructor Summary
TransitSection(Section s, int seq, int direction)
          Main constructor method
TransitSection(Section s, int seq, int direction, int act, int data, boolean alt)
          Convenience constructor
TransitSection(String secName, int seq, int direction, int act, int data, boolean alt)
          Special constructor to delay Section initialization
 
Method Summary
 int getAction()
           
 int getData()
           
 int getDirection()
           
 Section getSection()
          Access methods
 String getSectionName()
           
 int getSequenceNumber()
           
 boolean isAlternate()
           
 void setAction(int act)
           
 void setAlternate(boolean alt)
           
 void setData(int data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
Constants representing the Special Action requested for this Section

See Also:
Constant Field Values

PAUSE

public static final int PAUSE
See Also:
Constant Field Values

WAIT

public static final int WAIT
See Also:
Constant Field Values
Constructor Detail

TransitSection

public TransitSection(Section s,
                      int seq,
                      int direction)
Main constructor method


TransitSection

public TransitSection(Section s,
                      int seq,
                      int direction,
                      int act,
                      int data,
                      boolean alt)
Convenience constructor


TransitSection

public TransitSection(String secName,
                      int seq,
                      int direction,
                      int act,
                      int data,
                      boolean alt)
Special constructor to delay Section initialization

Method Detail

getSection

public Section getSection()
Access methods


getSectionName

public String getSectionName()

getDirection

public int getDirection()

getSequenceNumber

public int getSequenceNumber()

getAction

public int getAction()

setAction

public void setAction(int act)

getData

public int getData()

setData

public void setData(int data)

isAlternate

public boolean isAlternate()

setAlternate

public void setAlternate(boolean alt)


Copyright © 1997 - 2009 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads