|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
java.util.AbstractSequentialList
java.util.LinkedList
fi.joensuu.cs.tra.LinkedQueue
LinkedQueue extends java.util.LinkedList to highlight java.util.Queue-defined behaviour.
LinkedList
,
Queue
,
Serialized FormField 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
offer
in class LinkedList
o
- the element to insert.
public E poll()
poll
in interface Queue
poll
in class LinkedList
public E remove()
remove
in interface Queue
remove
in class LinkedList
NoSuchElementException
- if this queue is empty.public E peek()
peek
in interface Queue
peek
in class LinkedList
public E element()
element
in interface Queue
element
in class LinkedList
NoSuchElementException
- if this queue is empty.public void clear()
clear
in interface List
clear
in class LinkedList
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |