jmri.implementation
Class AbstractSignalMast

java.lang.Object
  extended by jmri.implementation.AbstractNamedBean
      extended by jmri.implementation.AbstractSignalMast
All Implemented Interfaces:
Serializable, NamedBean, SignalMast
Direct Known Subclasses:
SignalHeadSignalMast

public abstract class AbstractSignalMast
extends AbstractNamedBean
implements SignalMast, Serializable

Abstract class providing the basic logic of the SignalMast interface.

Author:
Bob Jacobsen Copyright (C) 2009
See Also:
Serialized Form

Field Summary
 
Fields inherited from class jmri.implementation.AbstractNamedBean
mSystemName, mUserName
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Constructor Summary
AbstractSignalMast(String systemName)
           
AbstractSignalMast(String systemName, String userName)
           
 
Method Summary
 String getAspect()
          Get current aspect name.
 boolean getHeld()
          "Held" parameter is just tracked and notified.
 boolean getLit()
          Default behavior for "lit" parameter is to track value and return it.
 String getSpeed()
           
 int getState()
          The state is the index of the current aspect in the list of possible aspects.
 void setAspect(String aspect)
          Set aspect to a valid name in the current signal system definition.
 void setHeld(boolean newHeld)
          Set the held parameter.
 void setLit(boolean newLit)
          Set the lit parameter.
 void setState(int i)
          Provide generic access to internal state.
 
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyKeys, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setUserName, updateListenerRef
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.SignalMast
getAppearanceMap, getSignalSystem, getValidAspects
 
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, dispose, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyKeys, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setUserName, updateListenerRef
 

Constructor Detail

AbstractSignalMast

public AbstractSignalMast(String systemName,
                          String userName)

AbstractSignalMast

public AbstractSignalMast(String systemName)
Method Detail

setAspect

@OverrideMustInvoke
public void setAspect(String aspect)
Description copied from interface: SignalMast
Set aspect to a valid name in the current signal system definition.

Specified by:
setAspect in interface SignalMast

getAspect

public String getAspect()
Description copied from interface: SignalMast
Get current aspect name. This is a bound property.

Specified by:
getAspect in interface SignalMast
Returns:
null if not yet set

getSpeed

public String getSpeed()

getState

public int getState()
The state is the index of the current aspect in the list of possible aspects.

Specified by:
getState in interface NamedBean

setState

public void setState(int i)
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

getLit

public boolean getLit()
Default behavior for "lit" parameter is to track value and return it.

Specified by:
getLit in interface SignalMast

getHeld

public boolean getHeld()
"Held" parameter is just tracked and notified.

Specified by:
getHeld in interface SignalMast

setLit

@OverrideMustInvoke
public void setLit(boolean newLit)
Set the lit parameter. This acts on all the SignalHeads included in this SignalMast

Specified by:
setLit in interface SignalMast

setHeld

@OverrideMustInvoke
public void setHeld(boolean newHeld)
Set the held parameter.

Note that this does not directly effect the output on the layout; the held parameter is a local variable which effects the aspect only via higher-level logic.

Specified by:
setHeld in interface SignalMast


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