T - Type of the item's to add in this queuepublic class CircularLossyQueue<T> extends Object
| Constructor and Description |
|---|
CircularLossyQueue(int size)
Constructs the circular queue with the specified capacity
|
| Modifier and Type | Method and Description |
|---|---|
int |
depth()
Returns the number of items currently in the queue
|
boolean |
isEmtpy()
Returns true if the queue is empty, otherwise false
|
T |
peek()
Returns value at the tail of the queue
|
void |
push(T newVal)
Adds a new item
|
T[] |
toArray(T[] type)
Returns an array of the current elements in the queue.
|
public CircularLossyQueue(int size)
size - must be > 0public void push(T newVal)
newVal - value to pushpublic T[] toArray(@Nonnull T[] type)
type - destinationpublic T peek()
public boolean isEmtpy()
public int depth()
Copyright © 2016–2021 Philip Helger. All rights reserved.