org.almendra.commons.util.collection
Interface IQueue

All Known Implementing Classes:
CommandQueue, CommandSchedulerQueue, PriorityQueue

public interface IQueue

Defines a minimal interface for any kind of collection that implements sequential queue accees.

Author:
Oliver Plohmann

Method Summary
 boolean add(java.lang.Object object)
          Add an object to the queue.
 java.lang.Object getNext()
          Remove the first object from the queue and return it.
 boolean hasNext()
          Answer whether ther is at least another object in the queue.
 boolean isEmpty()
          Answer true in case the queue is empty otherwise false.
 java.util.Iterator iterator()
          Return an iterator with which to iterate over the queue objects.
 java.lang.Object remove(java.lang.Object object)
          Remove an object from the queue.
 int size()
          Answer the number of objects in the queue.
 

Method Detail

hasNext

boolean hasNext()
Answer whether ther is at least another object in the queue.

Returns:

getNext

java.lang.Object getNext()
Remove the first object from the queue and return it.

Returns:

add

boolean add(java.lang.Object object)
Add an object to the queue.

Parameters:
object - the object to be added
Returns:
true if adding the object to the queue was successful otherwise false

remove

java.lang.Object remove(java.lang.Object object)
Remove an object from the queue.

Parameters:
object -
Returns:
the removed object or null if not found.

size

int size()
Answer the number of objects in the queue.

Returns:

isEmpty

boolean isEmpty()
Answer true in case the queue is empty otherwise false.

Returns:

iterator

java.util.Iterator iterator()
Return an iterator with which to iterate over the queue objects.

Returns: