public final class FixedSizeIntegerQueue
extends java.lang.Object
| Constructor and Description |
|---|
FixedSizeIntegerQueue(int capacity)
Create a queue of fixed size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Empty the queue.
|
void |
enqueue(int e)
Add an element to the queue.
|
boolean |
isEmpty()
Check if the queue has any items.
|
int |
poll()
Poll the first element from the queue.
|
int |
size()
Returns the number of items in the queue.
|
java.lang.String |
toString()
Returns a textual representation of the queue.
|
public FixedSizeIntegerQueue(int capacity)
capacity - size of the queuepublic void enqueue(int e)
e - elementpublic int poll()
public boolean isEmpty()
public int size()
public void clear()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2019. All Rights Reserved.