Class RatRunnable

  • All Implemented Interfaces:
    adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.SizeOfHandler, adams.core.Stoppable, adams.core.StoppableWithFeedback, Serializable, Runnable

    public class RatRunnable
    extends adams.flow.core.RunnableWithLogging
    Runnable class for Rat used in a thread.
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Modifier and Type Field Description
      protected boolean m_HasActors
      whether we have any actors to apply to the data.
      protected Rat m_Owner
      the owning Rat.
      protected boolean m_Paused
      whether the execution has been paused.
      • Fields inherited from class adams.flow.core.RunnableWithLogging

        m_Running, m_Stopped
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Constructor Summary

      Constructor Description
      RatRunnable​(Rat owner, boolean paused)
      Initializes the runnable.
    • Field Detail

      • m_Owner

        protected Rat m_Owner
        the owning Rat.
      • m_HasActors

        protected boolean m_HasActors
        whether we have any actors to apply to the data.
      • m_Paused

        protected boolean m_Paused
        whether the execution has been paused.
    • Constructor Detail

      • RatRunnable

        public RatRunnable​(Rat owner,
                           boolean paused)
        Initializes the runnable.
        owner - the owning actor
        paused - whether to start in paused mode
    • Method Detail

      • getOwner

        public Rat getOwner()
        Returns the owning actor.
        the owner
      • transmit

        protected String transmit​(Object data)
        Transmits the data.
        data - the data to transmit, ignored if null
        null if successful, otherwise error message
      • doRun

        protected void doRun()
        Performs the actual execution.
        Specified by:
        doRun in class adams.flow.core.RunnableWithLogging
      • postRun

        protected void postRun()
        Hook method after the run finished.
        postRun in class adams.flow.core.RunnableWithLogging
      • pauseExecution

        public void pauseExecution()
        Pauses the execution.
      • resumeExecution

        public void resumeExecution()
        Resumes the execution.
      • isPaused

        public boolean isPaused()
        Returns whether the execution has been suspended.
        true if paused
      • stopExecution

        public void stopExecution()
        Stops the execution.
        Specified by:
        stopExecution in interface adams.core.Stoppable
        stopExecution in class adams.flow.core.RunnableWithLogging