org.almendra.janet.cas.schedulers
Class CommandSchedulerQueue

java.lang.Object
  extended by org.almendra.janet.cas.schedulers.CommandSchedulerQueue
All Implemented Interfaces:
IQueue

public class CommandSchedulerQueue
extends java.lang.Object
implements IQueue

Author:
Oliver Plohmann

Field Summary
protected  java.util.LinkedList list
           
protected  EDU.oswego.cs.dl.util.concurrent.ReentrantWriterPreferenceReadWriteLock lock
           
 
Constructor Summary
CommandSchedulerQueue()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

protected java.util.LinkedList list

lock

protected EDU.oswego.cs.dl.util.concurrent.ReentrantWriterPreferenceReadWriteLock lock
Constructor Detail

CommandSchedulerQueue

public CommandSchedulerQueue()
Method Detail

getNext

public java.lang.Object getNext()
Description copied from interface: IQueue
Remove the first object from the queue and return it.

Specified by:
getNext in interface IQueue
Returns:

add

public boolean add(java.lang.Object object)
Description copied from interface: IQueue
Add an object to the queue.

Specified by:
add in interface IQueue
Parameters:
object - the object to be added
Returns:
true if adding the object to the queue was successful otherwise false

isEmpty

public boolean isEmpty()
Description copied from interface: IQueue
Answer true in case the queue is empty otherwise false.

Specified by:
isEmpty in interface IQueue
Returns:

size

public int size()
Description copied from interface: IQueue
Answer the number of objects in the queue.

Specified by:
size in interface IQueue
Returns:

remove

public java.lang.Object remove(java.lang.Object object)
Description copied from interface: IQueue
Remove an object from the queue.

Specified by:
remove in interface IQueue
Returns:
the removed object or null if not found.

hasNext

public boolean hasNext()
Description copied from interface: IQueue
Answer whether ther is at least another object in the queue.

Specified by:
hasNext in interface IQueue
Returns:

iterator

public java.util.Iterator iterator()
Description copied from interface: IQueue
Return an iterator with which to iterate over the queue objects.

Specified by:
iterator in interface IQueue
Returns: