Interface Signal
-
- All Superinterfaces:
java.lang.Comparable<NamedBean>
,NamedBean
,PropertyChangeProvider
- All Known Subinterfaces:
SignalHead
,SignalMast
- All Known Implementing Classes:
AbstractSignalHead
,AbstractSignalMast
,AcelaSignalHead
,BiDiBSignalMast
,DccSignalHead
,DccSignalMast
,DefaultSignalHead
,DoubleTurnoutSignalHead
,LNCPSignalMast
,LsDecSignalHead
,MatrixSignalMast
,MergSD2SignalHead
,MqttSignalMast
,OlcbSignalMast
,QuadOutputSignalHead
,SE8cSignalHead
,SE8cSignalHead
,SerialSignalHead
,SignalHeadSignalMast
,SingleTurnoutSignalHead
,TripleOutputSignalHead
,TripleTurnoutSignalHead
,TurnoutSignalMast
,VirtualSignalHead
,VirtualSignalMast
public interface Signal extends NamedBean
Represent a single signal, either inSignalHead
orSignalMast
form.This interface defines two bound parameters:
- Lit
- Whether the signal's lamps are lit or left dark.
This differs from the DARK color or all-off appearance. Lit is intended to allow you to extinguish a signal for approach lighting, while still allowing it to be set to a definite appearance or aspect for e.g. display on a panel or evaluation in higher level logic.
- Held
- Whether the signal's lamps should be forced to a specific appearance or
aspect, e.g. RED or STOP, in higher-level logic.
For use in signaling systems, this is a convenient way of storing whether a higher-level of control (e.g. non-vital system or dispatcher) has "held" the signal at stop. It does not effect how this signal actually works; any appearance can be set and will be displayed even when "held" is set.
The following can be relied on:
- isCleared() && isAtStop() is false: they are disjoint.
- isAtStop() && isShowingRestricting() is false: they are disjoint.
- isShowingRestricting() && isCleared() is false: they are disjoint.
- isAtStop() || isShowingRestricting() || isCleared() is usually true, but it can be false; the three methods do not cover all cases
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
-
Field Summary
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
getHeld()
Get whether the signal is held.boolean
getLit()
Get whether the signal is lit or dark.boolean
isAtStop()
Determine whether this signal shows an aspect or appearance that forbid travel past it.boolean
isCleared()
Determine whether this signal shows an aspect or appearance that allows travel past it, e.g. it's "been cleared".boolean
isShowingRestricting()
Determine whether this signal shows an aspect or appearance that allows travel past it only at restricted speed.void
setHeld(boolean newHeld)
void
setLit(boolean newLit)
-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getBeanType, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getState, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setState, setUserName, toString, updateListenerRef, vetoableChange
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Method Detail
-
isCleared
boolean isCleared()
Determine whether this signal shows an aspect or appearance that allows travel past it, e.g. it's "been cleared". This might be a yellow or green appearance, or an Approach or Clear aspect.- Returns:
- true if the signal is showing a clear indication; false otherwise
-
isShowingRestricting
boolean isShowingRestricting()
Determine whether this signal shows an aspect or appearance that allows travel past it only at restricted speed. This might be a flashing red appearance, or a Restricting aspect.- Returns:
- true if the signal is showing a restricting indication; false otherwise
-
isAtStop
boolean isAtStop()
Determine whether this signal shows an aspect or appearance that forbid travel past it. This might be a red appearance, or a Stop aspect. Stop-and-Proceed or Restricting would return false here.- Returns:
- true if the signal is showing a stop indication; false otherwise
-
getLit
boolean getLit()
Get whether the signal is lit or dark. Changes to this value can be listened to using the Lit property.- Returns:
- true if lit; false if dark
-
setLit
void setLit(boolean newLit)
-
getHeld
boolean getHeld()
Get whether the signal is held. Changes to this value can be listened to using the Held property. It controls what mechanisms can control the signal's appearance. The actual semantics are defined by those external mechanisms.- Returns:
- true if held; false otherwise
-
setHeld
void setHeld(boolean newHeld)
-
-