com.web_visage.ichat
Class OutgoingMessagesQueue

java.lang.Object
  extended by com.web_visage.ichat.OutgoingMessagesQueue

public class OutgoingMessagesQueue
extends java.lang.Object

Outgoing messages queue.

Allows adding/removing iChat message-receiver pairs into the queue.

Requires external synchronization.

Author:
K.Baturytski

Constructor Summary
OutgoingMessagesQueue()
          Constructor.
 
Method Summary
 void add(IChatMessageReceiverPair aMessage)
          Adds a message to the queue.
 void clear()
          Clears the queue.
 boolean hasNext()
          Checks whether the queue has next element.
 IChatMessageReceiverPair next()
          Returns next queue item and removes the last element from the queue.
 int size()
          Returns the queue size.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutgoingMessagesQueue

public OutgoingMessagesQueue()
Constructor.

Method Detail

add

public void add(IChatMessageReceiverPair aMessage)
Adds a message to the queue.

Parameters:
aMessage - - iChat message

next

public IChatMessageReceiverPair next()
                              throws MessageQueueIsEmptyException
Returns next queue item and removes the last element from the queue.

Returns:
Throws:
MessageQueueIsEmptyException

hasNext

public boolean hasNext()
Checks whether the queue has next element.

Returns:

size

public int size()
Returns the queue size.

Returns:

clear

public void clear()
Clears the queue.