cz.cuni.amis.nb.pogamut.base.logging
Class LimitedQueue<T>
java.lang.Object
cz.cuni.amis.nb.pogamut.base.logging.LimitedQueue<T>
public class LimitedQueue<T>
- extends Object
Queue with limited capacity. If size of the queue is greater than the capacity
then the oldest objects are removed.
- Author:
- kero
|
Constructor Summary |
LimitedQueue()
Creates a new instance of LimitedQueue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
deque
protected ArrayDeque<T> deque
capacity
protected int capacity
- Capacity of queue.
LimitedQueue
public LimitedQueue()
- Creates a new instance of LimitedQueue
setCapacity
public void setCapacity(int newCapacity)
- Sets new capacity of this queue.
add
public void add(T lr)
getAll
public Deque<T> getAll()
clear
public void clear()
Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.