Package: groovy.concurrent

## [Java] Class ChannelSelect.Result

- groovy.concurrent.ChannelSelect.Result

-     public static final class ChannelSelect.Result
      extends Object

  The result of a select() operation, indicating which offer committed.

  Since:
    6.0.0

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public AsyncChannel<?>` | `getChannel()` The channel the committed offer transferred over: the one received from, or the one sent to.
    `` | `public int` | `getIndex()` The zero-based index of the offer that committed.
    `<T>` | `public T` | `getValue()` The transferred value: what arrived, for a receive offer; what was sent, for a send offer; the Instant it fired, for a timer offer.
    `` | `public boolean` | `isSend()` Whether the committed offer was a send (an output guard).
    `` | `public boolean` | `isTimeout()` Whether the committed offer was a timer created by ChannelSelect.after: the select timed out, and getValue() is the instant at which it did.
    `` | `public String` | `toString()` Returns a diagnostic representation of this selection result.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public AsyncChannel<?> getChannel()

      The channel the committed offer transferred over: the one received from, or the one sent to. Lets a branch be recognised by identity rather than by position, which suits a select whose offers are assembled dynamically. A timer offer transfers over no channel of the caller's, so for a timeout this is `null`: a select that carries a timer offer and dispatches on the channel must test isTimeout() first, and dereference the channel only when that is `false`.

      Returns:
        the winning channel, or `null` for a timeout
      See Also:
        isTimeout()
      Since:
        6.0.0

    - #### public int getIndex()

      The zero-based index of the offer that committed.

    - #### <T> public T getValue()

      The transferred value: what arrived, for a receive offer; what was sent, for a send offer; the Instant it fired, for a timer offer.

    - #### public boolean isSend()

      Whether the committed offer was a send (an output guard).

      Since:
        6.0.0

    - #### public boolean isTimeout()

      Whether the committed offer was a timer created by ChannelSelect.after: the select timed out, and getValue() is the instant at which it did.

      Since:
        6.0.0

    - #### public String toString()

      Returns a diagnostic representation of this selection result.

      Returns:
        the selection result description