jmri
Class BlockManager

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

public class BlockManager
extends AbstractManager
implements PropertyChangeListener

Basic Implementation of a BlockManager.

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

Note this is a concrete class, unlike the interface/implementation pairs of most Managers, because there are currently only one implementation for Blocks.


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

Field Summary
 
Fields inherited from class jmri.AbstractManager
_tsys, _tuser
 
Constructor Summary
BlockManager()
           
 
Method Summary
 Block createNewBlock(String systemName, String userName)
          Method to create a new Block if it does not exist Returns null if a Block with the same systemName or userName already exists, or if there is trouble creating a new Block.
 Block getBlock(String name)
          Method to get an existing Block.
 Block getBySystemName(String name)
           
 Block getByUserName(String key)
           
static BlockManager instance()
           
 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 java.beans.PropertyChangeListener
propertyChange
 

Constructor Detail

BlockManager

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

createNewBlock

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


getBlock

public Block getBlock(String name)
Method to get an existing Block. 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 Block getBySystemName(String name)

getByUserName

public Block getByUserName(String key)

instance

public static BlockManager 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