Package org.jmxtrans.agent.util.collect
Class EvictingQueue<E>
java.lang.Object
org.jmxtrans.agent.util.collect.ForwardingCollection<E>
org.jmxtrans.agent.util.collect.ForwardingQueue<E>
org.jmxtrans.agent.util.collect.EvictingQueue<E>
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Queue<E>
public class EvictingQueue<E> extends ForwardingQueue<E> implements Queue<E>
- Author:
- Cyrille Le Clerc
-
Constructor Summary
Constructors Constructor Description EvictingQueue(int capacity) -
Method Summary
Modifier and Type Method Description booleanadd(E e)booleanaddAll(Collection<? extends E> c)protected booleanaddEvictingIfNeeded(E e)static <E> EvictingQueue<E>create(int maxCapacity)protected Queue<E>delegate()booleanoffer(E e)Methods inherited from class org.jmxtrans.agent.util.collect.ForwardingQueue
element, peek, poll, removeMethods inherited from class org.jmxtrans.agent.util.collect.ForwardingCollection
clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, standardAddAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Constructor Details
-
EvictingQueue
public EvictingQueue(int capacity)
-
-
Method Details
-
create
-
delegate
- Specified by:
delegatein classForwardingQueue<E>
-
add
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceQueue<E>- Overrides:
addin classForwardingQueue<E>
-
addAll
- Specified by:
addAllin interfaceCollection<E>- Overrides:
addAllin classForwardingCollection<E>
-
offer
-
addEvictingIfNeeded
-