jmri
Class DefaultLogixManager

java.lang.Object
  extended by jmri.AbstractManager
      extended by jmri.DefaultLogixManager
All Implemented Interfaces:
PropertyChangeListener, EventListener, LogixManager, Manager

public class DefaultLogixManager
extends AbstractManager
implements LogixManager, PropertyChangeListener

Basic Implementation of a LogixManager.

Note that Logix system names must begin with IX, and be followed by a string, usually, but not always, a number. All alphabetic characters in a Logix system name must be upper case. This is enforced when a Logix is created.

The system names of Conditionals belonging to a Logix begin with the Logix's system name, then there is a capital C and a number.

Author:
Dave Duchamp Copyright (C) 2007

Field Summary
 
Fields inherited from class jmri.AbstractManager
_tsys, _tuser
 
Constructor Summary
DefaultLogixManager()
           
 
Method Summary
 void activateAllLogixs()
          Activate all Logixs that are not currently active This method is called after a configuration file is loaded.
 Logix createNewLogix(String systemName, String userName)
          Method to create a new Logix if the Logix does not exist Returns null if a Logix with the same systemName or userName already exists, or if there is trouble creating a new Logix.
 void deleteLogix(Logix x)
          Remove an existing Logix and delete all its conditionals.
 Logix getBySystemName(String name)
           
 Logix getByUserName(String key)
           
 Logix getLogix(String name)
          Method to get an existing Logix.
static DefaultLogixManager instance()
           
 void setLoadDisabled(boolean s)
          Support for loading Logixs in a disabled state to debug loops
 char systemLetter()
           
 char 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.LogixManager
dispose, getSystemNameList
 
Methods inherited from interface jmri.Manager
addPropertyChangeListener, deregister, makeSystemName, register, removePropertyChangeListener
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Constructor Detail

DefaultLogixManager

public DefaultLogixManager()
Method Detail

systemLetter

public char systemLetter()
Specified by:
systemLetter in interface Manager
Returns:
The system-specific prefix letter for a specific implementation

typeLetter

public char typeLetter()
Specified by:
typeLetter in interface Manager
Returns:
The type letter for a specific implementation

createNewLogix

public Logix createNewLogix(String systemName,
                            String userName)
Method to create a new Logix if the Logix does not exist Returns null if a Logix with the same systemName or userName already exists, or if there is trouble creating a new Logix.

Specified by:
createNewLogix in interface LogixManager

deleteLogix

public void deleteLogix(Logix x)
Remove an existing Logix and delete all its conditionals. Logix must have been deactivated before invoking this.

Specified by:
deleteLogix in interface LogixManager

activateAllLogixs

public void activateAllLogixs()
Activate all Logixs that are not currently active This method is called after a configuration file is loaded.

Specified by:
activateAllLogixs in interface LogixManager

getLogix

public Logix getLogix(String name)
Method to get an existing Logix. First looks up assuming that name is a User Name. If this fails looks up assuming that name is a System Name. If both fail, returns null.

Specified by:
getLogix in interface LogixManager
Returns:
null if no match found

getBySystemName

public Logix getBySystemName(String name)
Specified by:
getBySystemName in interface LogixManager

getByUserName

public Logix getByUserName(String key)
Specified by:
getByUserName in interface LogixManager

setLoadDisabled

public void setLoadDisabled(boolean s)
Description copied from interface: LogixManager
Support for loading Logixs in a disabled state to debug loops

Specified by:
setLoadDisabled in interface LogixManager

instance

public static DefaultLogixManager instance()


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