public interface Mailbox extends Clearable, IGroupable
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.Modifier and Type | Method and Description |
---|---|
void |
deliverAll(MessageKind kind)
Delivers all messages of the given kind 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)
Posts a new message to this mailbox.
|
void |
setCurrentGroup(CommunicationGroup group)
Sets the
CommunicationGroup that the receiver of this mailbox is associated with. |
void postMessage(Direction direction, Tuple update)
direction
- the direction of the updateupdate
- the update elementvoid deliverAll(MessageKind kind)
kind
- the message kindCommunicationGroup getCurrentGroup()
CommunicationGroup
of the receiver of this mailbox.getCurrentGroup
in interface IGroupable
void setCurrentGroup(CommunicationGroup group)
CommunicationGroup
that the receiver of this mailbox is associated with.setCurrentGroup
in interface IGroupable
group
- the communication groupboolean isEmpty()