Class AbstractBufferedRatInput

    • Field Detail

      • m_MaxBuffer

        protected int m_MaxBuffer
        the maximum number of items to buffer.
      • m_Buffer

        protected BlockingQueue m_Buffer
        the queue to use for buffering.
      • m_Current

        protected Object m_Current
        the current item to return.
      • m_PollTimeout

        protected int m_PollTimeout
        the internal timeout interval for polling the queue in msec.
    • Constructor Detail

      • AbstractBufferedRatInput

        public AbstractBufferedRatInput()
    • Method Detail

      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • setUp

        public String setUp()
        Hook method for performing checks at setup time.
        Specified by:
        setUp in interface RatInput
        Overrides:
        setUp in class AbstractRatInput
        Returns:
        null if successful, otherwise error message
      • getDefaultMaxBuffer

        protected int getDefaultMaxBuffer()
        Returns the default maximum for the buffer.
        Returns:
        the default
      • setMaxBuffer

        public void setMaxBuffer​(int value)
        Sets the maximum number of items to buffer.
        Specified by:
        setMaxBuffer in interface BufferedRatInput
        Parameters:
        value - the maximum number of items to buffer
      • getMaxBuffer

        public int getMaxBuffer()
        Returns the maximum number of items to buffer.
        Specified by:
        getMaxBuffer in interface BufferedRatInput
        Returns:
        the maximum number of items to buffer
      • maxBufferTipText

        public String maxBufferTipText()
        Returns the tip text for this property.
        Specified by:
        maxBufferTipText in interface BufferedRatInput
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • bufferData

        public void bufferData​(Object value)
        For buffering the data received from the webservice.
        Specified by:
        bufferData in interface BufferedRatInput
        Parameters:
        value - the data received
      • poll

        protected Object poll()
        Waits for the next data object, polling the queue.
        Returns:
        the data, null if none available (eg when stopped)
      • hasPendingOutput

        public boolean hasPendingOutput()
        Checks whether any output can be collected. Blocks till either stopped or data has arrived.
        Specified by:
        hasPendingOutput in interface RatInput
        Specified by:
        hasPendingOutput in class AbstractRatInput
        Returns:
        true if output available
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Specified by:
        cleanUp in interface adams.core.CleanUpHandler
        Overrides:
        cleanUp in class AbstractRatInput