jmri
Interface CatalogTreeManager

All Superinterfaces:
Manager
All Known Implementing Classes:
DefaultCatalogTreeManager

public interface CatalogTreeManager
extends Manager

Locate a CatalogTree object representing some specific information.

CatalogTree objects are obtained from a CatalogTreeManager, which in turn is generally located from the InstanceManager.

Much of the book-keeping is implemented in the AbstractCatalogTreeManager class, which can form the basis for a system-specific implementation.


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

Field Summary
static String[] IMAGE_FILTER
           
static String[] SCRIPT_FILTER
           
static String[] SOUND_FILTER
           
 
Method Summary
 CatalogTree getBySystemName(String systemName)
          Locate an instance based on a system name.
 CatalogTree getByUserName(String userName)
          Locate an instance based on a user name.
 CatalogTree getCatalogTree(String name)
          Locate via user name, then system name if needed.
 List<String> getSystemNameList()
          Get a list of all CatalogTree objects' system names.
 CatalogTree newCatalogTree(String systemName, String userName)
          Return an instance with the specified system and user names.
 
Methods inherited from interface jmri.Manager
addPropertyChangeListener, deregister, dispose, getSystemNameArray, makeSystemName, register, removePropertyChangeListener, systemLetter, typeLetter
 

Field Detail

IMAGE_FILTER

static final String[] IMAGE_FILTER

SOUND_FILTER

static final String[] SOUND_FILTER

SCRIPT_FILTER

static final String[] SCRIPT_FILTER
Method Detail

getCatalogTree

CatalogTree getCatalogTree(String name)
Locate via user name, then system name if needed. If that fails, return null

Parameters:
name -
Returns:
null if no match found

getBySystemName

CatalogTree getBySystemName(String systemName)
Locate an instance based on a system name. Returns null if no instance already exists.

Returns:
requested CatalogTree object or null if none exists

getByUserName

CatalogTree getByUserName(String userName)
Locate an instance based on a user name. Returns null if no instance already exists.

Returns:
requested CatalogTree object or null if none exists

newCatalogTree

CatalogTree newCatalogTree(String systemName,
                           String userName)
Return an instance with the specified system and user names. Note that two calls with the same arguments will get the same instance; there is only one CatalogTree object representing a given physical CatalogTree and therefore only one with a specific system or user name.

This will always return a valid object reference; a new object will be created if necessary. In that case:

Note that it is possible to make an inconsistent request if both addresses are provided, but the given values are associated with different objects. This is a problem, and we don't have a good solution except to issue warnings. This will mostly happen if you're creating CatalogTree objects when you should be looking them up.

Returns:
requested CatalogTree object (never null)

getSystemNameList

List<String> getSystemNameList()
Get a list of all CatalogTree objects' system names.

Specified by:
getSystemNameList in interface Manager


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