public final class FixedSizeIntegerQueue extends 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.
|
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()
Copyright © 2019. All rights reserved.