|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
java.util.LinkedList<E>
fi.joensuu.cs.tra.LinkedQueue<E>
public class LinkedQueue<E>
LinkedQueue extends java.util.LinkedList to highlight java.util.Queue-defined behaviour.
LinkedList,
Queue,
Serialized Form| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
LinkedQueue()
Creates an empty queue. |
|
LinkedQueue(Collection<? extends E> c)
Constructs a queue containing the elements of the specified collection, in the order they are returned by the collection's iterator. |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all of the elements from this queue |
E |
element()
Retrieves, but does not remove, the head of this queue. |
boolean |
offer(E o)
Inserts the specified element into the rear of this queue. |
E |
peek()
Retrieves, but does not remove, the head of this queue, returning null if this queue is empty. |
E |
poll()
Retrieves and removes the head of this queue, or null if this queue is empty. |
E |
remove()
Retrieves and removes the head of this queue. |
| Methods inherited from class java.util.LinkedList |
|---|
add, add, addAll, addAll, addFirst, addLast, 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, isEmpty, 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, isEmpty, iterator, listIterator, removeAll, retainAll, subList |
| Constructor Detail |
|---|
public LinkedQueue()
public LinkedQueue(Collection<? extends E> c)
c - the collection whose elements are to be placed into this queue.
NullPointerException - if the specified collection was null.| Method Detail |
|---|
public boolean offer(E o)
offer in interface Queue<E>offer in class LinkedList<E>o - the element to insert.
public E poll()
poll in interface Queue<E>poll in class LinkedList<E>public E remove()
remove in interface Queue<E>remove in class LinkedList<E>NoSuchElementException - if this queue is empty.public E peek()
peek in interface Queue<E>peek in class LinkedList<E>public E element()
element in interface Queue<E>element in class LinkedList<E>NoSuchElementException - if this queue is empty.public void clear()
clear in interface Collection<E>clear in interface List<E>clear in class LinkedList<E>
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||