jmri.jmrix.acela
Class AcelaLightManager

java.lang.Object
  extended by jmri.AbstractManager
      extended by jmri.AbstractLightManager
          extended by jmri.jmrix.acela.AcelaLightManager
All Implemented Interfaces:
PropertyChangeListener, EventListener, LightManager, Manager

public class AcelaLightManager
extends AbstractLightManager

Implement light manager for Acela systems

System names are "ALnnn", where nnn is the bit number without padding.

Based in part on AcelaTurnoutManager.java

Author:
Dave Duchamp Copyright (C) 2004, Bob Coleman Copyright (C) 2007, 2008 Based on CMRI serial example, modified to establish Acela support.

Field Summary
 
Fields inherited from class jmri.AbstractManager
_tsys, _tuser
 
Constructor Summary
AcelaLightManager()
           
 
Method Summary
 String convertSystemNameToAlternate(String systemName)
          Public method to convert system name to its alternate format Returns a normalized system name if system name is valid and has a valid alternate representation, else return "".
 Light createNewLight(String systemName, String userName)
          Method to create a new Light based on the system name Returns null if the system name is not in a valid format Assumes calling method has checked that a Light with this system name does not already exist
static AcelaLightManager instance()
          Allow access to AcelaLightManager
 String normalizeSystemName(String systemName)
          Public method to normalize a system name Returns a normalized system name if system name has a valid format, else returns "".
 void notifyLightCreationError(String conflict, int bitNum)
          Public method to notify user of Light creation error.
 char systemLetter()
          Returns the system letter for Acela
 boolean validSystemNameConfig(String systemName)
          Public method to validate system name for configuration returns 'true' if system name has a valid meaning in current configuration, else returns 'false'
 boolean validSystemNameFormat(String systemName)
          Public method to validate system name format returns 'true' if system name has a valid format, else returns 'false'
 
Methods inherited from class jmri.AbstractLightManager
activateAllLights, getBySystemName, getByUserName, getLight, newLight, provideLight, typeLetter
 
Methods inherited from class jmri.AbstractManager
addPropertyChangeListener, deregister, dispose, firePropertyChange, getInstanceBySystemName, getInstanceByUserName, getSystemNameList, makeSystemName, propertyChange, register, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.LightManager
dispose, getSystemNameList
 
Methods inherited from interface jmri.Manager
addPropertyChangeListener, deregister, makeSystemName, register, removePropertyChangeListener
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Constructor Detail

AcelaLightManager

public AcelaLightManager()
Method Detail

systemLetter

public char systemLetter()
Returns the system letter for Acela

Returns:
The system-specific prefix letter for a specific implementation

createNewLight

public Light createNewLight(String systemName,
                            String userName)
Method to create a new Light based on the system name Returns null if the system name is not in a valid format Assumes calling method has checked that a Light with this system name does not already exist

Specified by:
createNewLight in class AbstractLightManager
Returns:
new null

notifyLightCreationError

public void notifyLightCreationError(String conflict,
                                     int bitNum)
Public method to notify user of Light creation error.


validSystemNameFormat

public boolean validSystemNameFormat(String systemName)
Public method to validate system name format returns 'true' if system name has a valid format, else returns 'false'


validSystemNameConfig

public boolean validSystemNameConfig(String systemName)
Public method to validate system name for configuration returns 'true' if system name has a valid meaning in current configuration, else returns 'false'


normalizeSystemName

public String normalizeSystemName(String systemName)
Public method to normalize a system name

Returns a normalized system name if system name has a valid format, else returns "".

Specified by:
normalizeSystemName in interface LightManager
Overrides:
normalizeSystemName in class AbstractLightManager

convertSystemNameToAlternate

public String convertSystemNameToAlternate(String systemName)
Public method to convert system name to its alternate format

Returns a normalized system name if system name is valid and has a valid alternate representation, else return "".

Specified by:
convertSystemNameToAlternate in interface LightManager
Overrides:
convertSystemNameToAlternate in class AbstractLightManager

instance

public static AcelaLightManager instance()
Allow access to AcelaLightManager



Copyright © 1997 - 2008 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: SourceForge_Logo