T - Type of objects stored in this queuepublic class FixedSizeQueue<T>
extends java.lang.Object
| Constructor and Description |
|---|
FixedSizeQueue(int capacity)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
getSize() |
java.util.List<T> |
getValues() |
void |
put(T element)
Store an element in the buffer
|
void |
resizeTo(int newSize) |
public FixedSizeQueue(int capacity)
capacity - initial capacitypublic void put(T element)
element - element to storepublic java.util.List<T> getValues()
public int getSize()
public void resizeTo(int newSize)
newSize - new size of the buffer. If newSize is lower than the actual
size, the buffer will contain the last elements that have been
stored