jmri.jmrit.symbolicprog
Class NameFile

java.lang.Object
  extended by jmri.jmrit.XmlFile
      extended by jmri.jmrit.symbolicprog.NameFile

public class NameFile
extends XmlFile

Represents a set of standard names and aliases in memory.

This class doesn't provide tools for defining the names & aliases; that's done manually, or at least not done here, to create the file.

Initially, we only need one of these, so we use an "instance" method to locate the one associated with the "xml/names.xml" file.

Author:
Bob Jacobsen Copyright (C) 2001

Field Summary
protected  Hashtable<String,Element> _nameHash
           
 
Fields inherited from class jmri.jmrit.XmlFile
dtdLocation, xsltLocation
 
Constructor Summary
NameFile()
           
 
Method Summary
 boolean checkName(String name)
          Check to see if a name is present in the file
protected static String defaultNameFilename()
          Return the filename String for the default file, including location.
 Element elementFromName(String name)
           
static NameFile instance()
           
 Set<String> names()
           
 
Methods inherited from class jmri.jmrit.XmlFile
addDefaultInfo, backupFileName, checkFile, createFileNameWithDate, dumpElement, ensurePrefsPresent, findFile, getBuilder, getRootViaURI, getVerify, makeBackupFile, makeBackupFile, newDocument, newDocument, prefsDir, reportError1, reportError2, resourcesDir, revertBackupFile, rootFromFile, rootFromName, rootFromURL, scriptsDir, setScriptsFileLocationDefault, setUserFileLocationDefault, setVerify, userFileChooser, userFileChooser, userFileChooser, userFileChooser, userFileLocationDefault, writeXML, xmlDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_nameHash

protected Hashtable<String,Element> _nameHash
Constructor Detail

NameFile

public NameFile()
Method Detail

names

public Set<String> names()

elementFromName

public Element elementFromName(String name)

instance

public static NameFile instance()

checkName

public boolean checkName(String name)
Check to see if a name is present in the file


defaultNameFilename

protected static String defaultNameFilename()
Return the filename String for the default file, including location. This is here to allow easy override in tests.



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