Package jmri.jmrit.ussctc
Class TurnoutLock
- java.lang.Object
-
- jmri.jmrit.ussctc.TurnoutLock
-
- All Implemented Interfaces:
Lock
public class TurnoutLock extends java.lang.Object implements Lock
Lock if a turnout isn't in the desired state.Can be used to e.g. lock when a call-on (turnout) is set
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.jmrit.ussctc.Lock
Lock.Valid
-
-
Field Summary
Fields Modifier and Type Field Description (package private) NamedBeanHandle<Turnout>
turnout
(package private) int
value
-
Fields inherited from interface jmri.jmrit.ussctc.Lock
debugLockLogger, signalLockLogger, turnoutLockLogger
-
-
Constructor Summary
Constructors Constructor Description TurnoutLock(java.lang.String name, int okValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isLockClear(LockLogger lockLogger)
Test the lock conditionsjava.lang.String
toString()
-
-
-
Field Detail
-
turnout
NamedBeanHandle<Turnout> turnout
-
value
int value
-
-
Constructor Detail
-
TurnoutLock
public TurnoutLock(java.lang.String name, int okValue)
- Parameters:
name
- System or user name of turnout to monitorokValue
- If this value isn't present, the operation is locked out
-
-
Method Detail
-
isLockClear
public boolean isLockClear(LockLogger lockLogger)
Test the lock conditions- Specified by:
isLockClear
in interfaceLock
- Parameters:
lockLogger
- the logger on which to emit status messages- Returns:
- True if lock is clear and operation permitted
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-