jmri.implementation
Class DefaultSignalSystem

Show UML class diagram
java.lang.Object
  extended by jmri.implementation.AbstractNamedBean
      extended by jmri.implementation.DefaultSignalSystem
All Implemented Interfaces:
Serializable, NamedBean, SignalSystem

public class DefaultSignalSystem
extends AbstractNamedBean
implements SignalSystem

Default implementation of a basic signal system definition.

The default contents are taken from the NamedBeanBundle properties file. This makes creation a little more heavy-weight, but speeds operation.

See Also:
Serialized Form

Field Summary
protected  Hashtable<String,Hashtable<String,Object>> aspects
           
protected  Vector<String> imageTypes
           
protected  Vector<String> keys
           
(package private) static org.slf4j.Logger log
           
(package private)  float maximumLineSpeed
           
 
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, mUserName, parameters, pcs, register
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Constructor Summary
DefaultSignalSystem(String systemName)
           
DefaultSignalSystem(String systemName, String userName)
           
 
Method Summary
 boolean checkAspect(String aspect)
          Is this aspect known?
 String getAspect(Object obj, String key)
           
 Enumeration<String> getAspects()
          Get all aspects currently defined.
 Enumeration<String> getImageTypeList()
          Returns a list of the image/icon sets available for use with this signalling 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 signalling system
 void setProperty(String aspect, String key, Object value)
           
 void setState(int s)
          Provide generic access to internal state.
 String toString()
           
 
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyKeys, getSystemName, getUserName, removeProperty, removePropertyChangeListener, setComment, setProperty, setUserName, updateListenerRef
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, dispose, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyKeys, getSystemName, getUserName, removeProperty, removePropertyChangeListener, setComment, setProperty, setUserName, updateListenerRef
 

Field Detail

maximumLineSpeed

float maximumLineSpeed

aspects

protected Hashtable<String,Hashtable<String,Object>> aspects

keys

protected Vector<String> keys

imageTypes

protected Vector<String> imageTypes

log

static org.slf4j.Logger log
Constructor Detail

DefaultSignalSystem

public DefaultSignalSystem(String systemName,
                           String userName)

DefaultSignalSystem

public DefaultSignalSystem(String systemName)
Method Detail

setProperty

public void setProperty(String aspect,
                        String key,
                        Object value)
Specified by:
setProperty in interface SignalSystem

getProperty

public Object getProperty(String aspect,
                          String key)
Specified by:
getProperty in interface SignalSystem

setImageType

public void setImageType(String type)
Description copied from interface: SignalSystem
Add an image or icon type available for use with this signalling system

Specified by:
setImageType in interface SignalSystem

getImageTypeList

public Enumeration<String> getImageTypeList()
Description copied from interface: SignalSystem
Returns a list of the image/icon sets available for use with this signalling system. If no specific image types are provided for then an empty list is returned.

Specified by:
getImageTypeList in interface SignalSystem

getAspect

public String getAspect(Object obj,
                        String key)
Specified by:
getAspect in interface SignalSystem

getTable

protected Hashtable<String,Object> getTable(String aspect)

getAspects

public Enumeration<String> getAspects()
Description copied from interface: SignalSystem
Get all aspects currently defined.

Specified by:
getAspects in interface SignalSystem

getKeys

public Enumeration<String> 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 interface SignalSystem

checkAspect

public boolean checkAspect(String aspect)
Description copied from interface: SignalSystem
Is this aspect known?

Specified by:
checkAspect in interface SignalSystem

loadDefaults

public void loadDefaults()

getState

public int getState()
Description copied from interface: NamedBean
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 provided to make Jython script access easier to read.

Specified by:
getState in interface NamedBean

setState

public void setState(int s)
Description copied from interface: NamedBean
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 provided to make Jython script access easier to read.

Specified by:
setState in interface NamedBean

getMaximumLineSpeed

public float getMaximumLineSpeed()
Specified by:
getMaximumLineSpeed in interface SignalSystem

toString

public String toString()
Overrides:
toString in class Object


Copyright © 1997-2013 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