Package jmri.jmrix.loconet.ds64
Class SimpleTurnout
java.lang.Object
jmri.jmrix.loconet.ds64.SimpleTurnout
- Direct Known Subclasses:
SimpleTurnoutStateEntry
Provides a simple object to track a turnout number and the position of that
turnout.
Turnout numbering is the same as seen on a Digitrax throttle display; Tools using values from objects of this type must provide the appropriate transform to create turnout numbering which is suitable for use within LocoNet messaging.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor used if address is unknown.SimpleTurnout(Integer addr, boolean closed) Constructor used when the turnout address and position are known.SimpleTurnout(Integer addr, boolean closed, boolean unused) Constructor used when the turnout address, position, and validity state are known by the instantiating method. -
Method Summary
Modifier and TypeMethodDescriptionReturns the address field of the simpleTurnout object.booleanReturns position of the turnout as represented in an object field.booleanReturns the "used" state of the object, as represented in an object field.booleanisValid()Get the "validity" state of the simpleTurnout object.voidsetAddress(Integer addr) Sets the turnout address of the simpleTurnout object.voidsetIsClosed(boolean isclosed) Sets an object field to show the current position of a simpleTurnout object.voidDefine the turnout as "unused" within a field in the object.
-
Constructor Details
-
SimpleTurnout
Constructor used if address is unknown. The constructor creates an object which is marked as "unused". -
SimpleTurnout
Constructor used when the turnout address and position are known.Validity state is assumed to be "valid".
- Parameters:
addr- turnout addressclosed- true if turnout is closed, else false
-
SimpleTurnout
Constructor used when the turnout address, position, and validity state are known by the instantiating method.- Parameters:
addr- turnout addressclosed- true if turnout is closed, else falseunused- trud if turnout is unused, else false
-
-
Method Details
-
isValid
Get the "validity" state of the simpleTurnout object. This "validity" state does not necessarily reflect the "validity" state of a physical turnout.- Returns:
- true if the address is valid
-
setAddress
Sets the turnout address of the simpleTurnout object.- Parameters:
addr- address value
-
getAddress
Returns the address field of the simpleTurnout object.- Returns:
- the address from the GUI element
-
setIsClosed
Sets an object field to show the current position of a simpleTurnout object. This position does not necessarily reflect the actual position of an associated physical turnout.- Parameters:
isclosed- true if the object is to be marked as closed.
-
getIsClosed
Returns position of the turnout as represented in an object field. This position does not necessarily reflect the actual position of an associated physical turnout.- Returns:
- true if turnout position is closed, else false
-
getIsUnused
Returns the "used" state of the object, as represented in an object field. This does not necessarily reflect the actual "used" state of the physical device.- Returns:
- true if turnout is "unused", else false
-
setIsUnused
Define the turnout as "unused" within a field in the object.
-