cgl.narada.util
Class MessageQueue

java.lang.Object
  extended by cgl.narada.util.MessageQueue

public class MessageQueue
extends Object

An implementation of a Linked List ... which would serve as our infinite buffer.


Field Summary
protected static int EMPTY
          Specifies that the logger Queue is empty
protected static int NON_EMPTY_OR_FULL
          Specifies that the Queue is neither empty or full and can give and accept further data.
 
Constructor Summary
MessageQueue()
          MessageQueue constructor
 
Method Summary
 void addItemToTop(Object object)
           Adds an Item to the top of the message Queue
protected  Object clone()
          clone method comment.
 Object get()
          Gets a new Object from the MessageQueue.
 int getSize()
           
protected  int getState()
          Returns the current state of the MessageQueue
static void main(String[] args)
          The main method, with a built in test case for testing the linked list functions.
 void put(Object _object)
          Puts a new Object into the MessageQueue.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

protected static final int EMPTY
Specifies that the logger Queue is empty

See Also:
Constant Field Values

NON_EMPTY_OR_FULL

protected static final int NON_EMPTY_OR_FULL
Specifies that the Queue is neither empty or full and can give and accept further data.

See Also:
Constant Field Values
Constructor Detail

MessageQueue

public MessageQueue()
MessageQueue constructor

Method Detail

addItemToTop

public void addItemToTop(Object object)
Adds an Item to the top of the message Queue


clone

protected Object clone()
clone method comment.

Overrides:
clone in class Object

get

public Object get()
Gets a new Object from the MessageQueue. The item that is returned is the item that is on top of the linked list. If there are no items in the queue, the queue will be return a NULL.


getSize

public int getSize()
Returns:
int

getState

protected int getState()
Returns the current state of the MessageQueue


put

public void put(Object _object)
Puts a new Object into the MessageQueue. Will throw a NULL Pointer exception if you are trying to add a null object to the queue. This method needs to be a synchronized method.

Parameters:
_object - : The object to be inserted into the MessageQueue

main

public static void main(String[] args)
The main method, with a built in test case for testing the linked list functions.



For comments and suggestions please send e-mail to The NaradaBrokering Project