peer2me.message
Class LinkedPingRecipientsList

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

public class LinkedPingRecipientsList
extends java.lang.Object

This class is a dynamically linked list that is used by the framework to store pings that are ready to be sent. The list is processed by the PingQueueProcessor class. The list contains all the nodes that should be pinged.

Author:
Kim Saxlund
See Also:
Node, PingQueueProcessor

Constructor Summary
LinkedPingRecipientsList()
          Default constructor.
 
Method Summary
 Node getFirstNode()
          Returns the Node which is contained in the first element in the list.
 int getNumberOfNodesInList()
          Returns the number of nodes in the list
 void insert(Node node)
          Inserts a Node at the beginning of the list
 void insertLast(Node node)
          Inserts a PingRecipientObject 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

LinkedPingRecipientsList

public LinkedPingRecipientsList()
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(Node node)
Inserts a Node at the beginning of the list

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

insertLast

public void insertLast(Node node)
Inserts a PingRecipientObject at the end of the list

Parameters:
node - The node to be wrapped in the PingRecipientObject

getFirstNode

public Node getFirstNode()
Returns the Node 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 node in the list

getNumberOfNodesInList

public int getNumberOfNodesInList()
Returns the number of nodes in the list

Returns:
The number of nodes in the list