Java : PriorityBlockingQueue with Examples
PriorityBlockingQueue (Java SE 20 & JDK 20) API Examples.
You will find code examples on most PriorityBlockingQueue methods.
Summary
final long current = System.nanoTime();
final DoubleSupplier elapsedTime = () -> (System.nanoTime() - current) / 1000000000.0;
try (final var executor = Executors.newSingleThreadExecutor()) {
final var queue = new PriorityBlockingQueue<String>();
final var future = executor.submit(() -> {
try {
while (true) {
System.out.println(" take ...");
final var value = queue.take();
System.out.printf(" take OK! : value = %s (%f sec.)%n",
value, elapsedTime.getAsDouble());
}
} catch (InterruptedException e) {
System.out.println(" InterruptedException!");
}
});
System.out.printf("put values (%f sec.)%n", elapsedTime.getAsDouble());
queue.put("aaa");
queue.put("bbb");
queue.put("ccc");
TimeUnit.SECONDS.sleep(5);
System.out.printf("put values (%f sec.)%n", elapsedTime.getAsDouble());
queue.put("XXX");
queue.put("YYY");
queue.put("ZZZ");
TimeUnit.SECONDS.sleep(5);
System.out.println("future.cancel");
future.cancel(true);
}
// Result
// ↓
//put values (0.002364 sec.)
// take ...
// take OK! : value = aaa (0.004022 sec.)
// take ...
// take OK! : value = bbb (0.004228 sec.)
// take ...
// take OK! : value = ccc (0.004420 sec.)
// take ...
//put values (5.009203 sec.)
// take OK! : value = XXX (5.009556 sec.)
// take ...
// take OK! : value = YYY (5.009790 sec.)
// take ...
// take OK! : value = ZZZ (5.009974 sec.)
// take ...
//future.cancel
// InterruptedException!
record Item(String value, int priority) {
@Override
public String toString() {
return "%s(%d)".formatted(value, priority);
}
}
final var comparator = Comparator.comparingInt(Item::priority);
final var queue = new PriorityBlockingQueue<Item>(11, comparator);
System.out.println(queue); // []
System.out.println(queue.offer(new Item("aaa", 1))); // true
System.out.println(queue.offer(new Item("bbb", 2))); // true
System.out.println(queue.offer(new Item("ccc", 3))); // true
System.out.println(queue.offer(new Item("XXX", 100))); // true
System.out.println(queue.offer(new Item("YYY", 99))); // true
System.out.println(queue.offer(new Item("ZZZ", 98))); // true
System.out.println(queue); // [aaa(1), bbb(2), ccc(3), XXX(100), YYY(99), ZZZ(98)]
System.out.println(queue.poll()); // aaa(1)
System.out.println(queue.poll()); // bbb(2)
System.out.println(queue.poll()); // ccc(3)
System.out.println(queue.poll()); // ZZZ(98)
System.out.println(queue.poll()); // YYY(99)
System.out.println(queue.poll()); // XXX(100)
Constructors
PriorityBlockingQueue ()
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue); // []
System.out.println(queue.remainingCapacity()); // 2147483647
System.out.println(queue.offer("aaa")); // true
System.out.println(queue.offer("bbb")); // true
System.out.println(queue.offer("ccc")); // true
System.out.println(queue); // [aaa, bbb, ccc]
PriorityBlockingQueue (int initialCapacity)
final var queue = new PriorityBlockingQueue<Integer>(10000000);
System.out.println(queue); // []
final var startTime = System.nanoTime();
for (int i = 0; i < 4000000; i++) {
queue.add(i);
}
final var endTime = System.nanoTime();
// 0.197829 sec.
System.out.printf("%f sec.%n", (endTime - startTime) / 1000000000.0);
final var queue = new PriorityBlockingQueue<Integer>(1);
System.out.println(queue); // []
final var startTime = System.nanoTime();
for (int i = 0; i < 4000000; i++) {
queue.add(i);
}
final var endTime = System.nanoTime();
// 0.262046 sec.
System.out.printf("%f sec.%n", (endTime - startTime) / 1000000000.0);
Note that capacity in initialCapacity and remainingCapacity() have different meanings.
final var queue = new PriorityBlockingQueue<Integer>(100);
System.out.println(queue.remainingCapacity()); // 2147483647
PriorityBlockingQueue (int initialCapacity, Comparator<? super E> comparator)
Please see also PriorityBlockingQueue(int initialCapacity) for initialCapacity parameter.
record Item(String value, int priority) {
@Override
public String toString() {
return "%s(%d)".formatted(value, priority);
}
}
final var comparator = Comparator.comparingInt(Item::priority);
final var queue = new PriorityBlockingQueue<Item>(11, comparator);
System.out.println(queue); // []
System.out.println(queue.offer(new Item("aaa", 1))); // true
System.out.println(queue.offer(new Item("bbb", 2))); // true
System.out.println(queue.offer(new Item("ccc", 3))); // true
System.out.println(queue.offer(new Item("XXX", 100))); // true
System.out.println(queue.offer(new Item("YYY", 99))); // true
System.out.println(queue.offer(new Item("ZZZ", 98))); // true
System.out.println(queue); // [aaa(1), bbb(2), ccc(3), XXX(100), YYY(99), ZZZ(98)]
System.out.println(queue.poll()); // aaa(1)
System.out.println(queue.poll()); // bbb(2)
System.out.println(queue.poll()); // ccc(3)
System.out.println(queue.poll()); // ZZZ(98)
System.out.println(queue.poll()); // YYY(99)
System.out.println(queue.poll()); // XXX(100)
PriorityBlockingQueue (Collection<? extends E> c)
final var c = List.of("a", "b", "c");
final var queue = new PriorityBlockingQueue<>(c);
System.out.println(queue); // [a, b, c]
System.out.println(queue.size()); // 3
Methods
boolean add (E e)
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue); // []
System.out.println(queue.add("aaa")); // true
System.out.println(queue); // [aaa]
System.out.println(queue.add("bbb")); // true
System.out.println(queue); // [aaa, bbb]
System.out.println(queue.add("ccc")); // true
System.out.println(queue); // [aaa, bbb, ccc]
void clear ()
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue); // []
System.out.println(queue.offer("a")); // true
System.out.println(queue); // [a]
System.out.println(queue.offer("b")); // true
System.out.println(queue); // [a, b]
queue.clear();
System.out.println(queue); // []
Comparator<? super E> comparator ()
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue); // []
final var comparator = queue.comparator();
System.out.println(comparator); // null
final var queue = new PriorityBlockingQueue<String>(11, Comparator.reverseOrder());
System.out.println(queue); // []
final var comparator = queue.comparator();
System.out.println(Objects.equals(comparator, Comparator.reverseOrder())); // true
final var queue = new PriorityBlockingQueue<>(11, String.CASE_INSENSITIVE_ORDER);
System.out.println(queue); // []
final var comparator = queue.comparator();
System.out.println(Objects.equals(comparator, String.CASE_INSENSITIVE_ORDER)); // true
boolean contains (Object o)
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue.offer("aaa")); // true
System.out.println(queue.offer("bbb")); // true
System.out.println(queue.offer("ccc")); // true
System.out.println(queue); // [aaa, bbb, ccc]
System.out.println(queue.contains("aaa")); // true
System.out.println(queue.contains("bbb")); // true
System.out.println(queue.contains("XXX")); // false
int drainTo (Collection<? super E> c)
final var queue = new PriorityBlockingQueue<String>();
final var c = new ArrayList<String>();
System.out.println(queue.offer("aaa")); // true
System.out.println(queue); // [aaa]
System.out.println(c); // []
System.out.println(queue.drainTo(c)); // 1
System.out.println(queue); // []
System.out.println(c); // [aaa]
System.out.println(queue.offer("bbb")); // true
System.out.println(queue.offer("ccc")); // true
System.out.println(queue); // [bbb, ccc]
System.out.println(c); // [aaa]
System.out.println(queue.drainTo(c)); // 2
System.out.println(queue); // []
System.out.println(c); // [aaa, bbb, ccc]
int drainTo (Collection<? super E> c, int maxElements)
final var queue = new PriorityBlockingQueue<String>();
final var c = new ArrayList<String>();
System.out.println(queue.offer("aaa")); // true
System.out.println(queue.offer("bbb")); // true
System.out.println(queue.offer("ccc")); // true
System.out.println(queue); // [aaa, bbb, ccc]
System.out.println(c); // []
System.out.println(queue.drainTo(c, 10)); // 3
System.out.println(queue); // []
System.out.println(c); // [aaa, bbb, ccc]
System.out.println(queue.offer("XXX")); // true
System.out.println(queue.offer("YYY")); // true
System.out.println(queue.offer("ZZZ")); // true
System.out.println(queue); // [XXX, YYY, ZZZ]
System.out.println(c); // [aaa, bbb, ccc]
System.out.println(queue.drainTo(c, 2)); // 2
System.out.println(queue); // [ZZZ]
System.out.println(c); // [aaa, bbb, ccc, XXX, YYY]
void forEach (Consumer<? super E> action)
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue.offer("aaa")); // true
System.out.println(queue.offer("bbb")); // true
System.out.println(queue.offer("ccc")); // true
System.out.println(queue); // [aaa, bbb, ccc]
System.out.println("-- forEach --");
queue.forEach(value -> {
System.out.println("value = " + value);
});
// Result
// ↓
//-- forEach --
//value = aaa
//value = bbb
//value = ccc
Iterator<E> iterator ()
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue.offer("aaa")); // true
System.out.println(queue.offer("bbb")); // true
System.out.println(queue.offer("ccc")); // true
System.out.println(queue); // [aaa, bbb, ccc]
final var iterator = queue.iterator();
System.out.println("-- forEachRemaining --");
iterator.forEachRemaining(value -> {
System.out.println("value = " + value);
});
// Result
// ↓
//-- forEachRemaining --
//value = aaa
//value = bbb
//value = ccc
boolean offer (E e)
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue); // []
System.out.println(queue.offer("aaa")); // true
System.out.println(queue); // [aaa]
System.out.println(queue.offer("bbb")); // true
System.out.println(queue); // [aaa, bbb]
System.out.println(queue.offer("ccc")); // true
System.out.println(queue); // [aaa, bbb, ccc]
boolean offer (E e, long timeout, TimeUnit unit)
Please see also : offer(E e)
As the queue is unbounded, this method will never block.
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue); // []
System.out.println(queue.remainingCapacity()); // 2147483647
System.out.println(queue.offer("aaa", 10, TimeUnit.SECONDS)); // true
System.out.println(queue); // [aaa]
System.out.println(queue.offer("bbb", 10, TimeUnit.SECONDS)); // true
System.out.println(queue); // [aaa, bbb]
E peek ()
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue); // []
System.out.println(queue.offer("aaa")); // true
System.out.println(queue.offer("bbb")); // true
System.out.println(queue.offer("ccc")); // true
System.out.println(queue.peek()); // aaa
System.out.println(queue); // [aaa, bbb, ccc]
System.out.println(queue.poll()); // aaa
System.out.println(queue); // [bbb, ccc]
System.out.println(queue.peek()); // bbb
System.out.println(queue); // [bbb, ccc]
System.out.println(queue.poll()); // bbb
System.out.println(queue); // [ccc]
System.out.println(queue.peek()); // ccc
System.out.println(queue); // [ccc]
System.out.println(queue.poll()); // ccc
System.out.println(queue); // []
System.out.println(queue.peek()); // null
System.out.println(queue); // []
E poll ()
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue); // []
System.out.println(queue.offer("aaa")); // true
System.out.println(queue.offer("bbb")); // true
System.out.println(queue.offer("ccc")); // true
System.out.println(queue); // [aaa, bbb, ccc]
System.out.println(queue.poll()); // aaa
System.out.println(queue); // [bbb, ccc]
System.out.println(queue.poll()); // bbb
System.out.println(queue); // [ccc]
System.out.println(queue.poll()); // ccc
System.out.println(queue); // []
System.out.println(queue.poll()); // null
System.out.println(queue); // []
E poll (long timeout, TimeUnit unit)
Please see also : poll()
final long current = System.nanoTime();
final DoubleSupplier elapsedTime = () -> (System.nanoTime() - current) / 1000000000.0;
try (final var executor = Executors.newSingleThreadExecutor()) {
final var queue = new PriorityBlockingQueue<String>();
final var future = executor.submit(() -> {
try {
while (true) {
System.out.println(" poll ...");
final var value = queue.poll(5, TimeUnit.SECONDS);
System.out.printf(" poll value = %s (%f sec.)%n",
value, elapsedTime.getAsDouble());
}
} catch (InterruptedException e) {
System.out.println(" InterruptedException!");
}
});
System.out.printf("put values (%f sec.)%n", elapsedTime.getAsDouble());
queue.put("aaa");
queue.put("bbb");
queue.put("ccc");
TimeUnit.SECONDS.sleep(8);
System.out.println("future.cancel");
future.cancel(true);
}
// Result
// ↓
//put values (0.002233 sec.)
// poll ...
// poll value = aaa (0.003545 sec.)
// poll ...
// poll value = bbb (0.003715 sec.)
// poll ...
// poll value = ccc (0.003865 sec.)
// poll ...
// poll value = null (5.013690 sec.)
// poll ...
//future.cancel
// InterruptedException!
void put (E e)
As the queue is unbounded, this method will never block.
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue); // []
System.out.println(queue.remainingCapacity()); // 2147483647
queue.put("aaa");
System.out.println(queue); // [aaa]
queue.put("bbb");
System.out.println(queue); // [aaa, bbb]
int remainingCapacity ()
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue); // []
final var capacity = queue.remainingCapacity();
System.out.println(capacity); // 2147483647
System.out.println(capacity == Integer.MAX_VALUE); // true
System.out.println(queue.offer("aaa")); // true
System.out.println(queue); // [aaa]
System.out.println(queue.remainingCapacity()); // 2147483647
System.out.println(queue.offer("bbb")); // true
System.out.println(queue); // [aaa, bbb]
System.out.println(queue.remainingCapacity()); // 2147483647
boolean remove (Object o)
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue.offer("aaa")); // true
System.out.println(queue.offer("aaa")); // true
System.out.println(queue.offer("bbb")); // true
System.out.println(queue.offer("bbb")); // true
System.out.println(queue.offer("ccc")); // true
System.out.println(queue); // [aaa, aaa, bbb, bbb, ccc]
System.out.println(queue.remove("aaa")); // true
System.out.println(queue); // [aaa, bbb, bbb, ccc]
System.out.println(queue.remove("bbb")); // true
System.out.println(queue); // [aaa, ccc, bbb]
System.out.println(queue.remove("bbb")); // true
System.out.println(queue); // [aaa, ccc]
System.out.println(queue.remove("XXX")); // false
System.out.println(queue); // [aaa, ccc]
boolean removeAll (Collection<?> c)
final var src = List.of("a", "b", "a", "b", "A", "B");
System.out.println(src); // [a, b, a, b, A, B]
{
final var queue = new PriorityBlockingQueue<>(src);
System.out.println(queue); // [A, a, B, b, b, a]
System.out.println(queue.removeAll(List.of())); // false
System.out.println(queue); // [A, a, B, b, b, a]
}
{
final var queue = new PriorityBlockingQueue<>(src);
System.out.println(queue); // [A, a, B, b, b, a]
System.out.println(queue.removeAll(List.of("a"))); // true
System.out.println(queue); // [A, B, b, b]
}
{
final var queue = new PriorityBlockingQueue<>(src);
System.out.println(queue); // [A, a, B, b, b, a]
System.out.println(queue.removeAll(List.of("a", "b"))); // true
System.out.println(queue); // [A, B]
}
{
final var queue = new PriorityBlockingQueue<>(src);
System.out.println(queue); // [A, a, B, b, b, a]
System.out.println(queue.removeAll(List.of("b", "a"))); // true
System.out.println(queue); // [A, B]
}
{
final var queue = new PriorityBlockingQueue<>(src);
System.out.println(queue); // [A, a, B, b, b, a]
System.out.println(queue.removeAll(List.of("A"))); // true
System.out.println(queue); // [B, a, b, b, a]
}
{
final var queue = new PriorityBlockingQueue<>(src);
System.out.println(queue); // [A, a, B, b, b, a]
System.out.println(queue.removeAll(List.of("X", "Y", "Z"))); // false
System.out.println(queue); // [A, a, B, b, b, a]
}
{
final var queue = new PriorityBlockingQueue<>(src);
System.out.println(queue); // [A, a, B, b, b, a]
System.out.println(queue.removeAll(List.of("A", "X", "Y", "Z"))); // true
System.out.println(queue); // [B, a, b, b, a]
}
boolean removeIf (Predicate<? super E> filter)
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue.offer("aaa")); // true
System.out.println(queue.offer("BBB")); // true
System.out.println(queue.offer("ccc")); // true
System.out.println(queue.offer("DDD")); // true
System.out.println(queue); // [BBB, DDD, ccc, aaa]
final var ret = queue.removeIf(s -> {
return s.equals(s.toUpperCase());
});
System.out.println(ret); // true
System.out.println(queue); // [aaa, ccc]
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue.offer("aaa")); // true
System.out.println(queue.offer("bbb")); // true
System.out.println(queue); // [aaa, bbb]
final var ret = queue.removeIf(s -> s.equals(s.toUpperCase()));
System.out.println(ret); // false
System.out.println(queue); // [aaa, bbb]
boolean retainAll (Collection<?> c)
final var src = List.of("a", "b", "a", "b", "A", "B");
System.out.println(src); // [a, b, a, b, A, B]
{
final var queue = new PriorityBlockingQueue<>(src);
System.out.println(queue); // [A, a, B, b, b, a]
System.out.println(queue.retainAll(List.of())); // true
System.out.println(queue); // []
}
{
final var queue = new PriorityBlockingQueue<>(src);
System.out.println(queue); // [A, a, B, b, b, a]
System.out.println(queue.retainAll(List.of("a", "b"))); // true
System.out.println(queue); // [a, a, b, b]
}
{
final var queue = new PriorityBlockingQueue<>(src);
System.out.println(queue); // [A, a, B, b, b, a]
System.out.println(queue.retainAll(List.of("b", "a"))); // true
System.out.println(queue); // [a, a, b, b]
}
{
final var queue = new PriorityBlockingQueue<>(src);
System.out.println(queue); // [A, a, B, b, b, a]
System.out.println(queue.retainAll(List.of("A"))); // true
System.out.println(queue); // [A]
}
{
final var queue = new PriorityBlockingQueue<>(src);
System.out.println(queue); // [A, a, B, b, b, a]
System.out.println(queue.retainAll(List.of("X", "Y", "Z"))); // true
System.out.println(queue); // []
}
{
final var queue = new PriorityBlockingQueue<>(src);
System.out.println(queue); // [A, a, B, b, b, a]
System.out.println(queue.retainAll(List.of("A", "X", "Y", "Z"))); // true
System.out.println(queue); // [A]
}
{
final var queue = new PriorityBlockingQueue<>(src);
System.out.println(queue); // [A, a, B, b, b, a]
System.out.println(queue.retainAll(List.of("a", "b", "A", "B"))); // false
System.out.println(queue); // [A, a, B, b, b, a]
}
int size ()
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue); // []
System.out.println(queue.size()); // 0
System.out.println(queue.offer("aaa")); // true
System.out.println(queue); // [aaa]
System.out.println(queue.size()); // 1
System.out.println(queue.offer("bbb")); // true
System.out.println(queue); // [aaa, bbb]
System.out.println(queue.size()); // 2
System.out.println(queue.offer("ccc")); // true
System.out.println(queue); // [aaa, bbb, ccc]
System.out.println(queue.size()); // 3
queue.clear();
System.out.println(queue); // []
System.out.println(queue.size()); // 0
Spliterator<E> spliterator ()
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue.offer("aaa")); // true
System.out.println(queue.offer("bbb")); // true
System.out.println(queue.offer("ccc")); // true
System.out.println(queue); // [aaa, bbb, ccc]
final var spliterator = queue.spliterator();
System.out.println("-- forEachRemaining --");
spliterator.forEachRemaining(value -> {
System.out.println("value = " + value);
});
// Result
// ↓
//-- forEachRemaining --
//value = aaa
//value = bbb
//value = ccc
E take ()
final long current = System.nanoTime();
final DoubleSupplier elapsedTime = () -> (System.nanoTime() - current) / 1000000000.0;
try (final var executor = Executors.newSingleThreadExecutor()) {
final var queue = new PriorityBlockingQueue<String>();
final var future = executor.submit(() -> {
try {
while (true) {
System.out.println(" take ...");
final var value = queue.take();
System.out.printf(" take OK! : value = %s (%f sec.)%n",
value, elapsedTime.getAsDouble());
}
} catch (InterruptedException e) {
System.out.println(" InterruptedException!");
}
});
System.out.printf("put values (%f sec.)%n", elapsedTime.getAsDouble());
queue.put("aaa");
queue.put("bbb");
queue.put("ccc");
TimeUnit.SECONDS.sleep(5);
System.out.printf("put values (%f sec.)%n", elapsedTime.getAsDouble());
queue.put("XXX");
queue.put("YYY");
queue.put("ZZZ");
TimeUnit.SECONDS.sleep(5);
System.out.println("future.cancel");
future.cancel(true);
}
// Result
// ↓
//put values (0.002364 sec.)
// take ...
// take OK! : value = aaa (0.004022 sec.)
// take ...
// take OK! : value = bbb (0.004228 sec.)
// take ...
// take OK! : value = ccc (0.004420 sec.)
// take ...
//put values (5.009203 sec.)
// take OK! : value = XXX (5.009556 sec.)
// take ...
// take OK! : value = YYY (5.009790 sec.)
// take ...
// take OK! : value = ZZZ (5.009974 sec.)
// take ...
//future.cancel
// InterruptedException!
Object[] toArray ()
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue.offer("a")); // true
System.out.println(queue.offer("b")); // true
System.out.println(queue.offer("c")); // true
System.out.println(queue); // [a, b, c]
final Object[] array = queue.toArray();
System.out.println(Arrays.toString(array)); // [a, b, c]
<T> T[] toArray (T[] a)
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue.offer("a")); // true
System.out.println(queue.offer("b")); // true
System.out.println(queue.offer("c")); // true
System.out.println(queue); // [a, b, c]
final String[] array = queue.toArray(new String[0]);
System.out.println(Arrays.toString(array)); // [a, b, c]
final var queue = new PriorityBlockingQueue<String>();
System.out.println(queue.offer("a")); // true
System.out.println(queue.offer("b")); // true
System.out.println(queue.offer("c")); // true
System.out.println(queue); // [a, b, c]
{
final String[] array = new String[3];
System.out.println(Arrays.toString(array)); // [null, null, null]
final var ret = queue.toArray(array);
System.out.println(Arrays.toString(array)); // [a, b, c]
System.out.println(Arrays.toString(ret)); // [a, b, c]
}
{
final String[] array = new String[5];
System.out.println(Arrays.toString(array)); // [null, null, null, null, null]
final var ret = queue.toArray(array);
System.out.println(Arrays.toString(array)); // [a, b, c, null, null]
System.out.println(Arrays.toString(ret)); // [a, b, c, null, null]
}
{
final String[] array = new String[1];
System.out.println(Arrays.toString(array)); // [null]
final var ret = queue.toArray(array);
System.out.println(Arrays.toString(array)); // [null]
System.out.println(Arrays.toString(ret)); // [a, b, c]
}
Methods declared in AbstractQueue
Methods declared in AbstractCollection
Methods declared in Collection
addAll, containsAll, equals, hashCode, isEmpty, parallelStream, stream, toArray
Please see the link below.
Methods declared in Queue
Related posts
- API Examples
- BlockingQueue
- Callable
- CancellationException
- ConcurrentHashMap.KeySetView
- ConcurrentLinkedDeque
- ConcurrentLinkedQueue
- ConcurrentMap
- ConcurrentModificationException
- ConcurrentSkipListSet
- Condition
- CopyOnWriteArrayList
- CopyOnWriteArraySet
- CountDownLatch
- CyclicBarrier
- Exchanger
- Executor
- ExecutorService
- Executors
- Future
- Future.State
- FutureTask
- InterruptedException
- Lock
- Runnable
- Semaphore
- Thread
- ThreadGroup
- ThreadLocal
- TimeUnit