Class DefaultSignalSystem
- All Implemented Interfaces:
Comparable<NamedBean>
,PropertyChangeProvider
,NamedBean
,SignalSystem
public class DefaultSignalSystem extends AbstractNamedBean implements SignalSystem
The default contents are taken from the NamedBeanBundle properties file. This makes creation a little more heavy-weight, but speeds operation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
Field Summary
Fields Modifier and Type Field Description protected HashMap<String,Hashtable<String,Object>>
aspects
protected Vector<String>
imageTypes
protected Vector<String>
keys
(package private) float
maximumLineSpeed
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, register
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
Constructor Summary
Constructors Constructor Description DefaultSignalSystem(String systemName)
DefaultSignalSystem(String systemName, String userName)
-
Method Summary
Modifier and Type Method Description boolean
checkAspect(String aspect)
Is this aspect known?String
getAspect(Object obj, String key)
Enumeration<String>
getAspects()
Get all aspects currently defined.String
getBeanType()
For instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.Enumeration<String>
getImageTypeList()
Returns a list of the image/icon sets available for use with this signaling system.Enumeration<String>
getKeys()
Get all keys currently defined on any aspect.float
getMaximumLineSpeed()
Object
getProperty(String aspect, String key)
int
getState()
Provide generic access to internal state.protected Hashtable<String,Object>
getTable(String aspect)
void
loadDefaults()
void
setImageType(String type)
Add an image or icon type available for use with this signaling system.void
setProperty(String aspect, String key, Object value)
void
setState(int s)
Provide generic access to internal state.String
summary()
Provide a multi-line summary of the signal system content, typically for printing.Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, describeState, dispose, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getFullyFormattedDisplayName, getFullyFormattedDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRef, vetoableChange
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getComment, getDisplayName, getDisplayName, getFullyFormattedDisplayName, getFullyFormattedDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef, vetoableChange
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
Constructor Details
-
Method Details
-
setProperty
- Specified by:
setProperty
in interfaceSignalSystem
-
getProperty
- Specified by:
getProperty
in interfaceSignalSystem
-
setImageType
Description copied from interface:SignalSystem
Add an image or icon type available for use with this signaling system.- Specified by:
setImageType
in interfaceSignalSystem
- Parameters:
type
- the image type
-
getImageTypeList
Description copied from interface:SignalSystem
Returns a list of the image/icon sets available for use with this signaling system.- Specified by:
getImageTypeList
in interfaceSignalSystem
- Returns:
- all image types or an empty list
-
getAspect
- Specified by:
getAspect
in interfaceSignalSystem
-
getTable
-
getAspects
Description copied from interface:SignalSystem
Get all aspects currently defined.- Specified by:
getAspects
in interfaceSignalSystem
- Returns:
- all aspects or an empty list
-
getKeys
Description copied from interface:SignalSystem
Get all keys currently defined on any aspect.Each key only appears once, even if used on more than one aspect.
Note that a given key may or may not appear on a given aspect.
- Specified by:
getKeys
in interfaceSignalSystem
- Returns:
- all keys or an empty list
-
checkAspect
Description copied from interface:SignalSystem
Is this aspect known?- Specified by:
checkAspect
in interfaceSignalSystem
- Parameters:
aspect
- the aspect to check- Returns:
- true if known; false otherwise
-
loadDefaults
-
getState
Provide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. getCommandedState in Turnout). This is provided to make scripts easier to read. This method returns a constant result on the DefaultSignalSystem.
- Specified by:
getState
in interfaceNamedBean
- Returns:
NamedBean.INCONSISTENT
-
setState
Provide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. setCommandedState in Turnout). This is provided to make scripts access easier to read. This method has no effect on the DefaultSignalSystem.
-
getMaximumLineSpeed
- Specified by:
getMaximumLineSpeed
in interfaceSignalSystem
-
getBeanType
Description copied from interface:NamedBean
For instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.- Specified by:
getBeanType
in interfaceNamedBean
- Returns:
- a string of the bean type, eg Turnout, Sensor etc
-
summary
Description copied from interface:SignalSystem
Provide a multi-line summary of the signal system content, typically for printing.Not intended for further parsing, i.e. for persistance, as format likely to differ from type to type, and to change often.
- Specified by:
summary
in interfaceSignalSystem
- Returns:
- summary string.
-