fc.util
Class Queue
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
java.util.LinkedList
fc.util.Queue
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable, Collection, List, Queue
public class Queue
- extends LinkedList
A thin wrapper around a java collection that provides queue semantics (FIFO).
- See Also:
- Serialized Form
|
Method Summary |
Object |
deque()
Dequeues an object from the beginning of the queue |
boolean |
empty()
Returns true is this queue is empty, false otherwise |
boolean |
enque(Object obj)
Enqueue's the specified object. |
static void |
main(String[] args)
|
| Methods inherited from class java.util.LinkedList |
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, peek, poll, remove, remove, remove, removeFirst, removeLast, set, size, toArray, toArray |
Queue
public Queue()
Queue
public Queue(Collection c)
enque
public boolean enque(Object obj)
- Enqueue's the specified object. Behaves as per
Collection.add(Object)
deque
public Object deque()
- Dequeues an object from the beginning of the queue
- Throws:
NoSuchElementException - if this list is empty.
empty
public boolean empty()
- Returns true is this queue is empty, false otherwise
main
public static void main(String[] args)