Package org.eclipse.viatra.query.runtime.rete.network.mailbox

## Interface Mailbox

- All Superinterfaces:
    `Clearable`, `IGroupable`
  All Known Subinterfaces:
    `AdaptableMailbox`, `FallThroughCapableMailbox`

      public interface Mailbox
      extends Clearable, IGroupable

  A mailbox is associated with every `Receiver`. Messages can be sent to a `Receiver` by posting them into the mailbox. Different mailbox implementations may differ in the way how they deliver the posted messages.
  Since:
    2.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `deliverAll​(MessageSelector selector)` | Delivers all messages according to the given selector from this mailbox.
    `CommunicationGroup` | `getCurrentGroup()` | Returns the `CommunicationGroup` of the receiver of this mailbox.
    `Receiver` | `getReceiver()` | Returns the `Receiver` of this mailbox.
    `boolean` | `isEmpty()` | Returns true if this mailbox is empty.
    `void` | `postMessage​(Direction direction, Tuple update, Timestamp timestamp)` | Posts a new message to this mailbox.
    `void` | `setCurrentGroup​(CommunicationGroup group)` | Sets the `CommunicationGroup` that the receiver of this mailbox is associated with.

    - ### Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.util.Clearable

      `clear`

- - ### Method Detail

    - #### postMessage

          void postMessage​(Direction direction,
                           Tuple update,
                           Timestamp timestamp)

      Posts a new message to this mailbox.
      Parameters:
        `direction` - the direction of the update
        `update` - the update element
      Since:
        2.4

    - #### deliverAll

          void deliverAll​(MessageSelector selector)

      Delivers all messages according to the given selector from this mailbox. The selector can also be null. In this case, no special separation is expected between the messages.
      Parameters:
        `selector` - the message selector

    - #### getReceiver

          Receiver getReceiver()

      Returns the `Receiver` of this mailbox.
      Returns:
        the receiver

    - #### getCurrentGroup

          CommunicationGroup getCurrentGroup()

      Returns the `CommunicationGroup` of the receiver of this mailbox.
      Specified by:
        `getCurrentGroup` in interface `IGroupable`
      Returns:
        the communication group

    - #### setCurrentGroup

          void setCurrentGroup​(CommunicationGroup group)

      Sets the `CommunicationGroup` that the receiver of this mailbox is associated with.
      Specified by:
        `setCurrentGroup` in interface `IGroupable`
      Parameters:
        `group` - the communication group

    - #### isEmpty

          boolean isEmpty()

      Returns true if this mailbox is empty.
      Returns: