com.web_visage.ichat
Class IncomingMessageQueue

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

public class IncomingMessageQueue
extends java.lang.Object

Message queue.

Allows adding/removing iChat messages into the queue.

Requires external synchonisation.

Author:
K.Baturytski

Constructor Summary
IncomingMessageQueue()
          Constructor.
 
Method Summary
 void add(IChatMessage aMessage)
          Adds a message to the queue.
 void clear()
          Clears the queue.
 boolean hasNext()
          Checks whether the queue has next element.
 IChatMessage 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

IncomingMessageQueue

public IncomingMessageQueue()
Constructor.

Method Detail

add

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

Parameters:
aMessage - - iChat message

next

public IChatMessage 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.