Package jmri.jmrix

Class AbstractNode

    • Constructor Detail

      • AbstractNode

        public AbstractNode()
        Create a new instance of AbstractNode.
    • Method Detail

      • getNodeAddress

        public int getNodeAddress()
        Public method to return the node address.
        node address number
      • setNodeAddress

        public void setNodeAddress​(int address)
        Public method to set the node address. Address range is checked in subclasses.
        address - address index to set in node
        java.lang.IllegalArgumentException - if out of range
      • checkNodeAddress

        protected abstract boolean checkNodeAddress​(int address)
        Check for valid address with respect to range, etc.
        address - node number to check.
        true if valid
      • createInitPacket

        public abstract AbstractMRMessage createInitPacket()
        Create the needed Initialization packet (AbstractMRMessage) for this node.
        the packet, or 'null' if not needed
      • createOutPacket

        public abstract AbstractMRMessage createOutPacket()
        Create a Transmit packet (AbstractMRMessage) to send current state.
        packet to send current node state.
      • getSensorsActive

        public abstract boolean getSensorsActive()
        Are any sensors present, and hence will this node need to be polled?
        'true' if at least one sensor is active for this node
      • handleTimeout

        public abstract boolean handleTimeout​(AbstractMRMessage m,
                                              AbstractMRListener l)
        Deal with a timeout in the transmission controller.
        m - message that didn't receive a reply
        l - listener that sent the message
        true if initialization is required
      • resetTimeout

        public abstract void resetTimeout​(AbstractMRMessage m)
        A reply was received, so there was no timeout, do any needed processing.
        m - message received that has reset the timeout and is waiting to be handled
      • mustSend

        public boolean mustSend()
        Get Must Send state.
        state of needSend flag.
      • resetMustSend

        public void resetMustSend()
        Public to reset state of needSend flag. Subclasses may override to enforce conditions.
      • setMustSend

        public void setMustSend()
        Public to set state of needSend flag.