Class OlcbSignalMast.StateMachine<T>

java.lang.Object
org.openlcb.AbstractConnection
org.openlcb.MessageDecoder
jmri.jmrix.openlcb.OlcbSignalMast.StateMachine<T>
All Implemented Interfaces:
org.openlcb.Connection
Enclosing class:
OlcbSignalMast

static class OlcbSignalMast.StateMachine<T>
extends org.openlcb.MessageDecoder
Implement a general state machine where state transitions are associated with the production and consumption of specific events. There's a one-to-one mapping between transitions and events. EventID storage is via Strings, so that the user-visible eventID string is preserved.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.openlcb.Connection

    org.openlcb.Connection.ConnectionListener
  • Field Summary

    Fields 
    Modifier and Type Field Description
    (package private) org.openlcb.Connection connection  
    protected HashMap<org.openlcb.EventID,​T> eventToState  
    (package private) boolean initizalized  
    (package private) org.openlcb.NodeID node  
    (package private) T state  
    protected HashMap<T,​org.openlcb.EventID> stateToEventID  
    protected HashMap<T,​String> stateToEventString  
  • Constructor Summary

    Constructors 
    Constructor Description
    StateMachine​(org.openlcb.Connection connection, org.openlcb.NodeID node, T start)  
  • Method Summary

    Modifier and Type Method Description
    org.openlcb.EventID getEventIDForState​(T key)  
    (package private) org.openlcb.EventState getEventIDState​(org.openlcb.EventID event)
    Internal method to determine the EventState for a reply to an Identify* method
    String getEventStringForState​(T key)  
    T getState()  
    void handleConsumerIdentified​(org.openlcb.ConsumerIdentifiedMessage msg, org.openlcb.Connection sender)
    void handleIdentifyConsumers​(org.openlcb.IdentifyConsumersMessage msg, org.openlcb.Connection sender)
    void handleIdentifyEvents​(org.openlcb.IdentifyEventsMessage msg, org.openlcb.Connection sender)
    void handleIdentifyProducers​(org.openlcb.IdentifyProducersMessage msg, org.openlcb.Connection sender)
    void handleProducerConsumerEventReport​(org.openlcb.ProducerConsumerEventReportMessage msg, org.openlcb.Connection sender)
    void handleProducerIdentified​(org.openlcb.ProducerIdentifiedMessage msg, org.openlcb.Connection sender)
    void sendAllIdentifiedMessages()
    Used at start up to emit the required messages, and in response to a IdentifyEvents message
    void setEventForState​(T key, String value)  
    void setState​(T newState)  

    Methods inherited from class org.openlcb.MessageDecoder

    defaultHandler, handleConsumerRangeIdentified, handleDatagram, handleDatagramAcknowledged, handleDatagramRejected, handleInitializationComplete, handleLearnEvent, handleOptionalIntRejected, handleProducerRangeIdentified, handleProtocolIdentificationReply, handleProtocolIdentificationRequest, handleSimpleNodeIdentInfoReply, handleSimpleNodeIdentInfoRequest, handleStreamDataComplete, handleStreamDataProceed, handleStreamDataSend, handleStreamInitiateReply, handleStreamInitiateRequest, handleTractionControlReply, handleTractionControlRequest, handleTractionProxyReply, handleTractionProxyRequest, handleVerifiedNodeIDNumber, handleVerifyNodeIDNumber, put

    Methods inherited from class org.openlcb.AbstractConnection

    registerStartNotification

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait