jmri.jmrit.logix
Class OBlockManager

java.lang.Object
  extended by jmri.managers.AbstractManager
      extended by jmri.jmrit.logix.OBlockManager
All Implemented Interfaces:
PropertyChangeListener, EventListener, Manager

public class OBlockManager
extends AbstractManager
implements PropertyChangeListener

Basic Implementation of a OBlockManager.

Note that this does not enforce any particular system naming convention.

Note this is a concrete class, there are now 2 types of Blocks (LayoutBlocks use a Block member. LBlocks use inheritance. Perhaps now the proxyManager strategy of interface/implementation pairs like other Managers should be implemented.


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:
Bob Jacobsen Copyright (C) 2006, Pete Cressman Copyright (C) 2009

Field Summary
 
Fields inherited from class jmri.managers.AbstractManager
_tsys, _tuser
 
Fields inherited from interface jmri.Manager
AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXS, MEMORIES, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS
 
Constructor Summary
OBlockManager()
           
 
Method Summary
 OBlock createNewOBlock(String systemName, String userName)
          Method to create a new OBlock if it does not exist Returns null if a OBlock with the same systemName or userName already exists, or if there is trouble creating a new OBlock.
 OBlock getBySystemName(String name)
           
 OBlock getByUserName(String key)
           
 OBlock getOBlock(String name)
          Method to get an existing OBlock.
 String getSystemPrefix()
          Provides access to the system prefix string.
 int getXMLOrder()
           
static OBlockManager instance()
           
 OBlock provideOBlock(String name)
           
 char typeLetter()
           
 
Methods inherited from class jmri.managers.AbstractManager
addPropertyChangeListener, deregister, dispose, firePropertyChange, getBeanBySystemName, getInstanceBySystemName, getInstanceByUserName, 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
 

Constructor Detail

OBlockManager

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

createNewOBlock

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


getOBlock

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


getBySystemName

public OBlock getBySystemName(String name)

getByUserName

public OBlock getByUserName(String key)

provideOBlock

public OBlock provideOBlock(String name)

instance

public static OBlockManager instance()


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