jade.core
Interface MessageQueue


public interface MessageQueue

The interface to be implemented by agent message queue implementations

Author:
Arend Freije
See Also:
Agent.createMessageQueue()

Method Summary
 void addFirst(ACLMessage msg)
          Add a message to the front of this queue.
 void addLast(ACLMessage msg)
          Add a message to the end of this queue.
 void copyTo(List list)
          Copy all messages to a given list.
 int getMaxSize()
          Return the maximum size of this queue.
 boolean isEmpty()
          Return true when this queue contains no messages.
 ACLMessage receive(MessageTemplate pattern)
          Return and remove the first message that matches the specified message template.
 void setMaxSize(int newSize)
          Set the maximum size of this queue.
 int size()
           
 

Method Detail

addFirst

public void addFirst(ACLMessage msg)
Add a message to the front of this queue.


addLast

public void addLast(ACLMessage msg)
Add a message to the end of this queue.


getMaxSize

public int getMaxSize()
Return the maximum size of this queue. This queue may remove old messages to prevent exeding the maximum size.


setMaxSize

public void setMaxSize(int newSize)
Set the maximum size of this queue. This queue may remove old messages to prevent exeding the maximum size.


isEmpty

public boolean isEmpty()
Return true when this queue contains no messages.


receive

public ACLMessage receive(MessageTemplate pattern)
Return and remove the first message that matches the specified message template.


copyTo

public void copyTo(List list)
Copy all messages to a given list.


size

public int size()
Returns:
the number of messages currently in the queue


JADE