Package com.google.common.collect
Class EvictingQueue<E>
java.lang.Object
com.google.common.collect.ForwardingObject
com.google.common.collect.ForwardingCollection<E>
com.google.common.collect.ForwardingQueue<E>
com.google.common.collect.EvictingQueue<E>
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Queue<E>
@Beta
@GwtIncompatible("java.util.ArrayDeque")
@Deprecated(since="2022-12-01")
public final class EvictingQueue<E>
extends ForwardingQueue<E>
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
A non-blocking queue which automatically evicts elements from the head of the queue when
attempting to add new elements onto the queue and it is full.
An evicting queue must be configured with a maximum size. Each time an element is added to a full queue, the queue automatically removes its head element. This is different from conventional bounded queues, which either block or reject new elements when full.
This class is not thread-safe, and does not accept null elements.
- Since:
- 15.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.Adds the given element to this queue.booleanaddAll(Collection<? extends E> collection) Deprecated.booleanDeprecated.static <E> EvictingQueue<E> create(int maxSize) Deprecated.Creates and returns a new evicting queue that will hold up tomaxSizeelements.booleanDeprecated.Adds the given element to this queue.booleanDeprecated.Methods inherited from class com.google.common.collect.ForwardingQueue
element, peek, poll, removeMethods inherited from class com.google.common.collect.ForwardingCollection
clear, containsAll, isEmpty, iterator, removeAll, retainAll, size, toArray, toArrayMethods inherited from class com.google.common.collect.ForwardingObject
toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
clear, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Method Details
-
create
Deprecated.Creates and returns a new evicting queue that will hold up tomaxSizeelements.When
maxSizeis zero, elements will be evicted immediately after being added to the queue. -
offer
Deprecated.Adds the given element to this queue. If the queue is currently full, the element at the head of the queue is evicted to make room. -
add
Deprecated.Adds the given element to this queue. If the queue is currently full, the element at the head of the queue is evicted to make room.- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceQueue<E>- Overrides:
addin classForwardingCollection<E>- Returns:
truealways
-
addAll
Deprecated.- Specified by:
addAllin interfaceCollection<E>- Overrides:
addAllin classForwardingCollection<E>
-
contains
Deprecated.- Specified by:
containsin interfaceCollection<E>- Overrides:
containsin classForwardingCollection<E>
-
remove
Deprecated.- Specified by:
removein interfaceCollection<E>- Overrides:
removein classForwardingCollection<E>
-