|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unibi.techfak.misc.Queue
public class Queue
A queue structure built through a LinkedList.
| Field Summary | |
|---|---|
private java.util.LinkedList |
fStack
The queue is represented via this list. |
| Constructor Summary | |
|---|---|
Queue()
Constructs an empty queue. |
|
| Method Summary | |
|---|---|
java.lang.Object |
element()
Retrieves, but does not remove, the head of this queue. |
boolean |
isEmpty()
|
java.util.ListIterator |
iterator(int index)
|
boolean |
offer(java.lang.Object elem)
Inserts the specified element into this queue, if possible. |
java.lang.Object |
peek()
Retrieves, but does not remove, the head of this queue, returning null, if this queue is empty. |
java.lang.Object |
poll()
Retrieves and removes the head of this queue, or null if this queue is empty. |
java.lang.Object |
remove()
Retrieves and removes the head of this queue. |
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final java.util.LinkedList fStack
| Constructor Detail |
|---|
public Queue()
| Method Detail |
|---|
public java.lang.Object element()
throws java.util.NoSuchElementException
java.util.NoSuchElementExceptionpublic java.lang.Object peek()
null, if this queue is empty.
public boolean offer(java.lang.Object elem)
elem - The element to insert into the queue.
true in case of success, false
otherwise.public java.lang.Object poll()
null.
public java.lang.Object remove()
throws java.util.NoSuchElementException
java.util.NoSuchElementException - If the queue is empty.public boolean isEmpty()
true or false, respectively,
whether the queue is empty or not.public int size()
public java.util.ListIterator iterator(int index)
throws java.lang.IndexOutOfBoundsException
index - The start in the iterator.
java.lang.IndexOutOfBoundsException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||