jmri
Class TransitManager

Show UML class diagram
java.lang.Object
  extended by jmri.managers.AbstractManager
      extended by jmri.TransitManager
All Implemented Interfaces:
PropertyChangeListener, EventListener, Manager

public class TransitManager
extends AbstractManager
implements PropertyChangeListener

Implementation of a Transit Manager

This doesn't need an interface, since Transits are globaly implemented, instead of being system-specific.

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


This file is part of JMRI.

JMRI is free 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.


Field Summary
(package private) static TransitManager _instance
           
(package private)  int lastAutoTransitRef
           
(package private) static org.slf4j.Logger log
           
(package private)  DecimalFormat paddedNumber
           
 
Fields inherited from class jmri.managers.AbstractManager
_tsys, _tuser
 
Fields inherited from interface jmri.Manager
AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, ENTRYEXIT, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXS, MEMORIES, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS
 
Constructor Summary
TransitManager()
           
 
Method Summary
 Transit createNewTransit(String userName)
          For use with User GUI, to allow the auto generation of systemNames, where the user can optionally supply a username.
 Transit createNewTransit(String systemName, String userName)
          Method to create a new Transit if the Transit does not exist Returns null if a Transit with the same systemName or userName already exists, or if there is trouble creating a new Transit.
 void deleteTransit(Transit z)
          Remove an existing Transit
 Transit getBySystemName(String name)
           
 Transit getByUserName(String key)
           
 ArrayList<Transit> getListUsingSection(Section s)
          Returns a list of Transits which use a specified Section
 String getSystemPrefix()
          Provides access to the system prefix string.
 Transit getTransit(String name)
          Method to get an existing Transit.
 int getXMLOrder()
           
static TransitManager instance()
           
 char typeLetter()
           
 
Methods inherited from class jmri.managers.AbstractManager
addPropertyChangeListener, deregister, dispose, firePropertyChange, getBeanBySystemName, getBeanByUserName, getInstanceBySystemName, getInstanceByUserName, getNamedBean, getNamedBeanList, getSystemNameArray, getSystemNameList, makeSystemName, propertyChange, register, registerSelf, removePropertyChangeListener, systemLetter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Field Detail

paddedNumber

DecimalFormat paddedNumber

lastAutoTransitRef

int lastAutoTransitRef

_instance

static TransitManager _instance

log

static org.slf4j.Logger log
Constructor Detail

TransitManager

public TransitManager()
Method Detail

getXMLOrder

public int getXMLOrder()
Specified by:
getXMLOrder in interface Manager
Specified by:
getXMLOrder in class AbstractManager

getSystemPrefix

public String getSystemPrefix()
Description copied from interface: Manager
Provides access to the system prefix string. This was previously called the "System letter"

Specified by:
getSystemPrefix in interface Manager

typeLetter

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

createNewTransit

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


createNewTransit

public Transit createNewTransit(String userName)
For use with User GUI, to allow the auto generation of systemNames, where the user can optionally supply a username. Note: Since system names should be kept short for use in Dispatcher, the :AUTO:000 has been removed from automatically generated system names. Autogenerated system names will use IZnn, where nn is the first available number.


getTransit

public Transit getTransit(String name)
Method to get an existing Transit. 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.

Parameters:
name -
Returns:
null if no match found

getBySystemName

public Transit getBySystemName(String name)

getByUserName

public Transit getByUserName(String key)

deleteTransit

public void deleteTransit(Transit z)
Remove an existing Transit


getListUsingSection

public ArrayList<Transit> getListUsingSection(Section s)
Returns a list of Transits which use a specified Section


instance

public static TransitManager instance()


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