Class FixedSizeQueue<T>
java.lang.Object
org.eclipse.nebula.widgets.opal.commons.FixedSizeQueue<T>
- Type Parameters:
T
- Type of objects stored in this queue
public class FixedSizeQueue<T>
extends java.lang.Object
Instance of this class are queues that have a fixed size.
When the queue is full, the elements are shifted and the first element is lost.
When the queue is full, the elements are shifted and the first element is lost.
-
Constructor Summary
Constructors Constructor Description FixedSizeQueue(int capacity)
Constructor -
Method Summary
-
Constructor Details
-
FixedSizeQueue
public FixedSizeQueue(int capacity)Constructor- Parameters:
capacity
- initial capacity
-
-
Method Details
-
put
Store an element in the buffer- Parameters:
element
- element to store
-
getValues
- Returns:
- all values stored in this queue
-
getSize
public int getSize()- Returns:
- size of the buffer
-
resizeTo
public void resizeTo(int newSize)- Parameters:
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
-