|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object br.usp.ime.klava.segmentit.structures.Queue<T>
T
- the type of elements held in this queuepublic class Queue<T>
Implements a queue, using a First In, First Out policy.
It uses a LinkedHashSet
internally, so:
Constructor Summary | |
---|---|
Queue()
Creates an empty queue. |
Method Summary | |
---|---|
void |
add(T element)
Appends the specified element to the end of this queue if it is not already present. |
void |
clear()
Removes all of the elements from this queue. |
boolean |
isEmpty()
Returns true if this queue contains no elements. |
T |
peek()
Returns the first element of the queue, without removing it. |
T |
remove()
Returns the first element of the queue, removing it. |
boolean |
removeElement(T element)
Removes the first occurrence of the specified element from this queue, if it is present. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Queue()
Method Detail |
---|
public void add(T element)
element
- element to be appended to this queuepublic T remove()
public T peek()
public boolean removeElement(T element)
element
- element to be removed from this list, if present
true
if this queue contained the specified elementpublic boolean isEmpty()
true
if this queue contains no elements.
true
if this queue contains no elementspublic void clear()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |