Package org.forester.datastructures
Class Queue
java.lang.Object
org.forester.datastructures.Queue
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Queue
public Queue()This created a new, empty Queue object.
-
-
Method Details
-
clear
public void clear()Removes all elements from this queue. -
dequeue
Dequeues one element from this queue.- Returns:
- the dequeued object
- Throws:
NoSuchElementException
- if this queue is empty
-
enqueue
Adds Object element to thisqueue.- Parameters:
element
- the Object to be enqueued
-
isEmpty
public boolean isEmpty()Returns whether or not this queue is empty.- Returns:
- true if this queue is empty, false otherwise
-