jmri
Class TransitManager

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

Author:
Dave Duchamp Copyright (C) 2008

Field Summary
 
Fields inherited from class jmri.implementation.AbstractManager
_tsys, _tuser
 
Constructor Summary
TransitManager()
           
 
Method Summary
 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)
           
 Transit getTransit(String name)
          Method to get an existing Transit.
static TransitManager instance()
           
 char systemLetter()
           
 char typeLetter()
           
 
Methods inherited from class jmri.implementation.AbstractManager
addPropertyChangeListener, deregister, dispose, firePropertyChange, getInstanceBySystemName, getInstanceByUserName, getSystemNameArray, getSystemNameList, makeSystemName, propertyChange, register, registerSelf, removePropertyChangeListener
 
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
 

Constructor Detail

TransitManager

public TransitManager()
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

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.


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


instance

public static TransitManager instance()


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