T
- element typepublic class UniqueBlockingQueue<T> extends AbstractQueue<T> implements BlockingQueue<T>
Constructor and Description |
---|
UniqueBlockingQueue(int capacity)
Constructor for a UniqueBlockingQueue.
|
Modifier and Type | Method and Description |
---|---|
int |
drainTo(Collection<? super T> c) |
int |
drainTo(Collection<? super T> c,
int maxElements) |
Iterator<T> |
iterator() |
boolean |
offer(T e) |
boolean |
offer(T e,
long timeout,
TimeUnit unit) |
T |
peek() |
T |
poll() |
T |
poll(long timeout,
TimeUnit unit) |
void |
put(T e) |
int |
remainingCapacity() |
int |
size() |
T |
take() |
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, contains, remove
addAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray
public UniqueBlockingQueue(int capacity)
capacity
- capacity of the blocking queuepublic void put(T e) throws InterruptedException
put
in interface BlockingQueue<T>
InterruptedException
public boolean offer(T e)
public boolean offer(T e, long timeout, TimeUnit unit) throws InterruptedException
offer
in interface BlockingQueue<T>
InterruptedException
public T take() throws InterruptedException
take
in interface BlockingQueue<T>
InterruptedException
public int remainingCapacity()
remainingCapacity
in interface BlockingQueue<T>
public int drainTo(Collection<? super T> c)
drainTo
in interface BlockingQueue<T>
public int drainTo(Collection<? super T> c, int maxElements)
drainTo
in interface BlockingQueue<T>
public Iterator<T> iterator()
iterator
in interface Iterable<T>
iterator
in interface Collection<T>
iterator
in class AbstractCollection<T>
public int size()
size
in interface Collection<T>
size
in class AbstractCollection<T>
public T poll(long timeout, TimeUnit unit) throws InterruptedException
poll
in interface BlockingQueue<T>
InterruptedException
Copyright © 2023. All Rights Reserved.