T - the type of objects held in this ConcurrentCollectionpublic class MultithreadConcurrentQueueCollection<T> extends Object implements ConcurrentCollection<T>
MultithreadConcurrentQueue based implementation of ConcurrentCollection.| Constructor and Description |
|---|
MultithreadConcurrentQueueCollection(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
void |
offerFirst(T object)
Adds the given
object at the head of the ConcurrentCollection. |
void |
offerLast(T object)
Adds the given
object at the tail of the ConcurrentCollection. |
T |
pollFirst()
Polls an
object from the head of the ConcurrentCollection. |
T |
pollLast()
Polls an
object from the tail of the ConcurrentCollection. |
int |
size()
Returns the number of elements in this collection.
|
public MultithreadConcurrentQueueCollection(int capacity)
public void offerFirst(T object)
ConcurrentCollectionobject at the head of the ConcurrentCollection.offerFirst in interface ConcurrentCollection<T>object - the given objectpublic void offerLast(T object)
ConcurrentCollectionobject at the tail of the ConcurrentCollection.offerLast in interface ConcurrentCollection<T>object - the given objectpublic T pollFirst()
ConcurrentCollectionobject from the head of the ConcurrentCollection.pollFirst in interface ConcurrentCollection<T>null otherwisepublic T pollLast()
ConcurrentCollectionobject from the tail of the ConcurrentCollection.pollLast in interface ConcurrentCollection<T>null otherwisepublic int size()
ConcurrentCollectionsize in interface ConcurrentCollection<T>Copyright © 2013-2019 vibur.org. All Rights Reserved.