peer2me.message
Class LinkedMessageList

java.lang.Object
  extended by peer2me.message.LinkedMessageList

public class LinkedMessageList
extends java.lang.Object

This class is a dynamically linked list that is used by the framework to store messages that are ready to be sent. The list is processed by the MessageQueueProcessor class.

Author:
Kim Saxlund
See Also:
MessageQueueProcessor, Message

Constructor Summary
LinkedMessageList()
          Default constructor.
 
Method Summary
 Message getFirstMessage()
          Returns the Message which is contained in the first element in the list.
 int getNumberOfMessagesInList()
          Returns the number of messages in the list
 void insert(Message message)
          Inserts a MessageListObject at the beginning of the list
 void insertLast(Message message)
          Inserts a MessageListObject at the end of the list
 boolean isEmpty()
          Checks to see if the list is empty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkedMessageList

public LinkedMessageList()
Default constructor. Creates an empty list

Method Detail

isEmpty

public boolean isEmpty()
Checks to see if the list is empty

Returns:
True if empty, false otherwise

insert

public void insert(Message message)
Inserts a MessageListObject at the beginning of the list

Parameters:
message - The message to be wrapped in the MessageListObject

insertLast

public void insertLast(Message message)
Inserts a MessageListObject at the end of the list

Parameters:
message - The message to be wrapped in the MessageListObject

getFirstMessage

public Message getFirstMessage()
Returns the Message which is contained in the first element in the list. It the removes the element from the list and sets the next element as the first element

Returns:
The first message in the list

getNumberOfMessagesInList

public int getNumberOfMessagesInList()
Returns the number of messages in the list

Returns:
The number of messages in the list