Package org.eclipse.epsilon.common.util
Class SizeCachingConcurrentQueue<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
java.util.concurrent.ConcurrentLinkedQueue<E>
org.eclipse.epsilon.common.util.SizeCachingConcurrentQueue<E>
- Type Parameters:
E-
- All Implemented Interfaces:
Serializable,Iterable<E>,Collection<E>,Queue<E>
A
ConcurrentLinkedQueue wrapper which supports null values
using a constant wrapper in place of null elements. This implementation caches
the size and updates it when structurally modified to avoid the issue outlined
in Java Specialists Issue 261.- Since:
- 1.6
- Author:
- Sina Madani
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.concurrent.ConcurrentLinkedQueue
add, clear, forEach, isEmpty, removeAll, removeIf, retainAll, spliterator, toArray, toArray, toStringMethods inherited from class java.util.AbstractQueue
element, removeMethods inherited from class java.util.AbstractCollection
containsAllMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
containsAll, parallelStream, stream, toArray
-
Field Details
-
NULL
-
size
-
offerSuper
-
-
Constructor Details
-
SizeCachingConcurrentQueue
public SizeCachingConcurrentQueue() -
SizeCachingConcurrentQueue
-
-
Method Details
-
replaceWithNull
-
convertToNull
-
peek
-
poll
-
offer
-
addAll
- Specified by:
addAllin interfaceCollection<E>- Overrides:
addAllin classConcurrentLinkedQueue<E>
-
remove
- Specified by:
removein interfaceCollection<E>- Overrides:
removein classConcurrentLinkedQueue<E>
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Overrides:
sizein classConcurrentLinkedQueue<E>
-
iterator
- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIterable<E>- Overrides:
iteratorin classConcurrentLinkedQueue<E>
-
contains
- Specified by:
containsin interfaceCollection<E>- Overrides:
containsin classConcurrentLinkedQueue<E>
-
equals
- Specified by:
equalsin interfaceCollection<E>- Overrides:
equalsin classObject
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<E>- Overrides:
hashCodein classObject
-