appia.protocols.utils
Class ListBuffer

java.lang.Object
  |
  +--appia.protocols.utils.ListBuffer
All Implemented Interfaces:
Buffer

public class ListBuffer
extends java.lang.Object
implements Buffer


Constructor Summary
ListBuffer()
           
 
Method Summary
 java.util.ListIterator getIterator(int index)
          gets a iterator of the buffer
 java.lang.Object getTail()
          gets the most recent message of the buffer
 void insertTail(java.lang.Object o)
          inserts a message at the end of the buffer
 boolean remove(java.lang.Object o)
          removes a specified object from the buffer.
 java.lang.Object removeHead()
          removes a message from the head of the buffer.
 int size()
          gets the size of the buffer (number of messages)
 java.lang.Object[] toArray()
          gets all elements of the buffer in a array format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListBuffer

public ListBuffer()
Method Detail

insertTail

public void insertTail(java.lang.Object o)
inserts a message at the end of the buffer

Specified by:
insertTail in interface Buffer

getTail

public java.lang.Object getTail()
gets the most recent message of the buffer

Specified by:
getTail in interface Buffer

removeHead

public java.lang.Object removeHead()
removes a message from the head of the buffer. return null if there are no messages.

Specified by:
removeHead in interface Buffer

remove

public boolean remove(java.lang.Object o)
removes a specified object from the buffer.

Specified by:
remove in interface Buffer

getIterator

public java.util.ListIterator getIterator(int index)
gets a iterator of the buffer

Specified by:
getIterator in interface Buffer

size

public int size()
gets the size of the buffer (number of messages)

Specified by:
size in interface Buffer

toArray

public java.lang.Object[] toArray()
gets all elements of the buffer in a array format

Specified by:
toArray in interface Buffer