org.jwarp.util
Class Queue

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.AbstractSequentialList
                    |
                    +--java.util.LinkedList
                          |
                          +--org.jwarp.util.Queue
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable
Direct Known Subclasses:
WorkQueue

public class Queue
extends java.util.LinkedList

Implements an object queue based on a linked list.

Author:
Anatole Tresch
See Also:
Serialized Form

Field Summary
protected  java.util.LinkedList queue
          The underlying list
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Queue()
          Creates a new queue
 
Method Summary
 boolean isEmpty()
           
 java.lang.Object pop()
          Get the next object or null if the queue ie empty
 void push(java.lang.Object object)
          Put a new object in the queue.
 
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, remove, remove, removeFirst, removeLast, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, removeAll, retainAll, subList
 

Field Detail

queue

protected java.util.LinkedList queue
The underlying list
Constructor Detail

Queue

public Queue()
Creates a new queue
Method Detail

push

public void push(java.lang.Object object)
Put a new object in the queue.
Parameters:
object - The new object

pop

public java.lang.Object pop()
Get the next object or null if the queue ie empty
Returns:
The nest object or null

isEmpty

public boolean isEmpty()
Overrides:
isEmpty in class java.util.AbstractCollection
Returns:
true if the queue is empty

©   O R C A   S y s t e m s