jmri.jmrit.dispatcher
Class AllocatedSection

java.lang.Object
  extended by jmri.jmrit.dispatcher.AllocatedSection

public class AllocatedSection
extends Object

This class holds information and options for an AllocatedSection, a Section that is currently allocated to an ActiveTrain.

AllocatedSections are referenced via a list in DispatcherFrame, which serves as a manager for AllocatedSection objects. Each ActiveTrain also maintains a list of AllocatedSections currently assigned to it.

AllocatedSections are transient, and are not saved to disk.

AllocatedSections keep track of whether they have been entered and exited.

If the Active Train this Section is assigned to is being run automatically, support is provided for monitoring Section changes and changes for Blocks within the Section.

This file is part of JMRI.

JMRI is open source software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Author:
Dave Duchamp Copyright (C) 2008-2011

Constructor Summary
AllocatedSection(Section s, ActiveTrain at, int seq, Section next, int nextSeqNo)
          Main constructor method
 
Method Summary
protected  void addToActiveBlockList(Block b)
           
 void dispose()
           
 ActiveTrain getActiveTrain()
           
 String getActiveTrainName()
           
 int getAllocationNumber()
           
 int getDirection()
           
protected  Block getEnterBlock(AllocatedSection previousAllocatedSection)
           
 boolean getEntered()
           
protected  Block getExitBlock()
           
 boolean getExited()
           
 PropertyChangeListener getExitSignalListener()
           
 Sensor getForwardStoppingSensor()
           
 int getIndex()
           
 int getLength()
           
 Section getNextSection()
           
 int getNextSectionSequence()
           
 Sensor getReverseStoppingSensor()
           
 Section getSection()
          Access methods
 String getSectionName()
           
 int getSequence()
           
protected  TransitSection getTransitSection()
           
 void initializeMonitorBlockOccupancy()
           
protected  boolean isInActiveBlockList(Block b)
           
protected  void removeFromActiveBlockList(Block b)
           
 void reset()
           
 void setAllocationNumber(int n)
           
 void setExitSignalListener(PropertyChangeListener xSigListener)
           
 void setIndex(int i)
          Access methods for automatic running instance variables
protected  void setStoppingSensors()
          Methods
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllocatedSection

public AllocatedSection(Section s,
                        ActiveTrain at,
                        int seq,
                        Section next,
                        int nextSeqNo)
Main constructor method

Parameters:
s - cannot be null
Method Detail

getSection

public Section getSection()
Access methods


getSectionName

public String getSectionName()

getActiveTrain

public ActiveTrain getActiveTrain()

getActiveTrainName

public String getActiveTrainName()

getSequence

public int getSequence()

getNextSection

public Section getNextSection()

getNextSectionSequence

public int getNextSectionSequence()

getEntered

public boolean getEntered()

getExited

public boolean getExited()

getAllocationNumber

public int getAllocationNumber()

setAllocationNumber

public void setAllocationNumber(int n)

getForwardStoppingSensor

public Sensor getForwardStoppingSensor()

getReverseStoppingSensor

public Sensor getReverseStoppingSensor()

setIndex

public void setIndex(int i)
Access methods for automatic running instance variables


getIndex

public int getIndex()

setExitSignalListener

public void setExitSignalListener(PropertyChangeListener xSigListener)

getExitSignalListener

public PropertyChangeListener getExitSignalListener()

setStoppingSensors

protected void setStoppingSensors()
Methods


getTransitSection

protected TransitSection getTransitSection()

getDirection

public int getDirection()

getLength

public int getLength()

reset

public void reset()

initializeMonitorBlockOccupancy

public void initializeMonitorBlockOccupancy()

getExitBlock

protected Block getExitBlock()

getEnterBlock

protected Block getEnterBlock(AllocatedSection previousAllocatedSection)

addToActiveBlockList

protected void addToActiveBlockList(Block b)

removeFromActiveBlockList

protected void removeFromActiveBlockList(Block b)

isInActiveBlockList

protected boolean isInActiveBlockList(Block b)

dispose

public void dispose()


Copyright © 1997 - 2011 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