Constructor and Description |
---|
Inbox() |
Modifier and Type | Method and Description |
---|---|
void |
add(Message message,
Timestamp receiptStamp)
Adds a message to this inbox.
|
void |
clear()
Removes all messages from this inbox.
|
Message |
first()
Returns the first message in this inbox.
|
boolean |
hasMessages(MessagePattern pattern) |
boolean |
isEmpty()
Indicates whether this inbox is empty.
|
Iterator<Message> |
iterator()
Returns an iterator that iterates the inbox in deterministic order of addition.
|
Message |
pollFirst()
Polls (retrieves and removes) the first message from this inbox.
|
void |
remove(Message message)
Removes the given message from this inbox.
|
int |
size()
Returns the amount of messages in this inbox.
|
public Message first()
NullPointerException
- if no message is in the inboxpublic Message pollFirst()
null
if the inbox is emptypublic void add(Message message, Timestamp receiptStamp)
message
- The message to be addedreceiptStamp
- The time when the message was received in the inbox.public boolean hasMessages(MessagePattern pattern)
public void remove(Message message)
message
- Message instance to be removed.IllegalArgumentException
- if this inbox contains no equal message.public void clear()
public boolean isEmpty()
true
if inbox is empty, false
otherwisepublic int size()
Copyright © Aimpulse Intelligent Systems GmbH
All rights reserved.