public class Queue extends Object
| Constructor and Description |
|---|
Queue()
This created a new, empty Queue object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all elements from this queue.
|
Object |
dequeue()
Dequeues one element from this queue.
|
void |
enqueue(Object element)
Adds Object element to thisqueue.
|
boolean |
isEmpty()
Returns whether or not this queue is empty.
|
public void clear()
public Object dequeue() throws NoSuchElementException
NoSuchElementException - if this queue is emptypublic void enqueue(Object element)
element - the Object to be enqueuedpublic boolean isEmpty()
Copyright © 2016. All rights reserved.