Interface DoubleReceivePort

  • All Superinterfaces:
    java.lang.AutoCloseable, Port<java.lang.Double>, PortAutoCloseable, ReceivePort<java.lang.Double>
    All Known Subinterfaces:
    DoubleChannel
    All Known Implementing Classes:
    QueueDoubleChannel

    public interface DoubleReceivePort
    extends ReceivePort<java.lang.Double>
    A primitive double channel's consumer-side interface. All methods of this interface must only be called by the channel's owner.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean hasMessage()
      Tests whether a value is pending in the channel.
      double receiveDouble()
      Retrieves a message from the channels, possibly blocking until one becomes available.
      double receiveDouble​(long timeout, java.util.concurrent.TimeUnit unit)
      Retrieves a message from the channels, possibly blocking until one becomes available, but no longer than the specified timeout.
      double receiveDouble​(Timeout timeout)
      Retrieves a message from the channels, possibly blocking until one becomes available, but no longer than the specified timeout.
    • Method Detail

      • receiveDouble

        double receiveDouble​(long timeout,
                             java.util.concurrent.TimeUnit unit)
                      throws SuspendExecution,
                             java.lang.InterruptedException,
                             java.util.concurrent.TimeoutException,
                             ReceivePort.EOFException
        Retrieves a message from the channels, possibly blocking until one becomes available, but no longer than the specified timeout. If the channel has been closed and no more messages await, this method throws an ReceivePort.EOFException.
        Parameters:
        timeout - the maximum duration to block waiting for a message.
        unit - the time unit of the timeout.
        Returns:
        a message. (see PortAutoCloseable.isClosed()), or if the timeout has expired.
        Throws:
        java.util.concurrent.TimeoutException - if the timeout has expired
        ReceivePort.EOFException - if the channel has been closed and no more messages await
        java.lang.InterruptedException
        SuspendExecution
      • receiveDouble

        double receiveDouble​(Timeout timeout)
                      throws SuspendExecution,
                             java.lang.InterruptedException,
                             java.util.concurrent.TimeoutException,
                             ReceivePort.EOFException
        Retrieves a message from the channels, possibly blocking until one becomes available, but no longer than the specified timeout. If the channel has been closed and no more messages await, this method throws an ReceivePort.EOFException.
        Parameters:
        timeout - the method will not block for longer than the amount remaining in the Timeout
        Returns:
        a message. (see PortAutoCloseable.isClosed()), or if the timeout has expired.
        Throws:
        java.util.concurrent.TimeoutException - if the timeout has expired
        ReceivePort.EOFException - if the channel has been closed and no more messages await
        java.lang.InterruptedException
        SuspendExecution
      • hasMessage

        boolean hasMessage()
        Tests whether a value is pending in the channel. If it is, the next call to receiveDouble is guaranteed not to block.
        Returns:
        true if a value is waiting in the channel; false otherwise.