fc.util
Class Queue

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by java.util.LinkedList
                  extended by fc.util.Queue
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, Deque, List, Queue

public class Queue
extends LinkedList

A thin wrapper around a java collection that provides queue semantics (FIFO).

See Also:
Serialized Form

Constructor Summary
Queue()
           
Queue(Collection c)
           
 
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, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 
Methods inherited from interface java.util.Deque
iterator
 

Constructor Detail

Queue

public Queue()

Queue

public Queue(Collection c)
Method Detail

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)