Package jadex.tools.comanalyzer
Class MessageList
- java.lang.Object
-
- jadex.tools.comanalyzer.MessageList
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable
public class MessageList extends java.lang.Object implements java.lang.Iterable, java.io.Serializable
This is the list of the recorded messages. This class provides methods to notify other classes which are implementing the IMessageListListener interface about adding, changing and removing messages.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MessageList()
Default constructor for the message list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addListener(IMessageListListener ml)
Register for message events.void
addMessage(Message msg)
Adds a message to the list.void
addMessages(Message[] messages)
boolean
containsMessage(Message message)
Checks if a message is contained in the message list.protected void
fireMessagesAdded(Message[] messages)
Notifies the listeners about the adding of messages.protected void
fireMessagesChanged(Message[] messages)
Notifies the listeners about messages with changed visibility.protected void
fireMessagesRemoved(Message[] messages)
Notifies the listeners about the removel of messages.java.util.List
getList()
Message[]
getMessages()
java.util.Iterator
iterator()
void
removeAllMessages()
Clear all messages in the list.void
removeMessage(Message msg)
void
removeMessages(Message[] messages)
int
size()
-
-
-
Method Detail
-
addMessage
public void addMessage(Message msg)
Adds a message to the list.- Parameters:
msg
- The message to add.
-
addMessages
public void addMessages(Message[] messages)
- Parameters:
messages
- The array of messages to add.
-
removeMessage
public void removeMessage(Message msg)
- Parameters:
msg
- The message to remove
-
removeMessages
public void removeMessages(Message[] messages)
- Parameters:
messages
- The array of messages to remove.
-
removeAllMessages
public void removeAllMessages()
Clear all messages in the list.
-
containsMessage
public boolean containsMessage(Message message)
Checks if a message is contained in the message list.- Parameters:
message
- The message to check.- Returns:
true
if a specific message is in the agentlist.
-
getMessages
public Message[] getMessages()
- Returns:
- The array of messages.
-
getList
public java.util.List getList()
- Returns:
- The list of agents
-
size
public int size()
- Returns:
- The size of the message list.
-
iterator
public java.util.Iterator iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable
- Returns:
- The message list iterator.
-
addListener
protected void addListener(IMessageListListener ml)
Register for message events.- Parameters:
listener
- A class implementing the IMessageListListener interface.
-
fireMessagesAdded
protected void fireMessagesAdded(Message[] messages)
Notifies the listeners about the adding of messages.- Parameters:
messages
- The added messages.
-
fireMessagesRemoved
protected void fireMessagesRemoved(Message[] messages)
Notifies the listeners about the removel of messages.- Parameters:
messages
- The removed messages.
-
fireMessagesChanged
protected void fireMessagesChanged(Message[] messages)
Notifies the listeners about messages with changed visibility.- Parameters:
messages
- The changed messages.
-
-