T - The type of elements collected.public class BoundedFIFOQueue<T> extends Object implements Iterable<T>, Serializable
BoundedFIFOQueue collects elements up to given amount. Reaching this limit will result in
removing the oldest element from this queue (First-In/First-Out; FIFO).| 构造器和说明 |
|---|
BoundedFIFOQueue(int maxSize)
Creates a
BoundedFIFOQueue with the given maximum size. |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(T element)
Adds an element to the end of the queue.
|
Iterator<T> |
iterator()
Returns the
BoundedFIFOQueue's Iterator. |
int |
size()
Returns the number of currently stored elements.
|
ArrayList<T> |
toArrayList() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic BoundedFIFOQueue(int maxSize)
BoundedFIFOQueue with the given maximum size.maxSize - The maximum size of this queue. Exceeding this limit would result in removing
the oldest element (FIFO).IllegalArgumentException - If maxSize is less than 0.public void add(T element)
element - The element that should be added to the end of the queue.NullPointerException - If null is passed as an element.public int size()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.