Java : BlockingDeque (ブロッキング・両端キュー) - API使用例
BlockingDeque (Java SE 20 & JDK 20) の使用例まとめです。
だいたいのメソッドを網羅済みです。
API仕様のおともにどうぞ。
概要
BlockingDeque インタフェースは、
- 要素を取り出すときに、もし空だったら要素が追加されるまで待機
という操作が可能な Deque です。
// 基準となる時刻
final long current = System.nanoTime();
// 基準となる時刻からの差分を秒として取得
final DoubleSupplier elapsedTime = () -> (System.nanoTime() - current) / 1000000000.0;
try (final var executor = Executors.newSingleThreadExecutor()) {
final BlockingDeque<String> deque = new LinkedBlockingDeque<>();
final var future = executor.submit(() -> {
try {
while (true) {
System.out.println(" take ...");
final var value = deque.takeFirst();
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());
deque.putLast("aaa");
deque.putLast("bbb");
deque.putLast("ccc");
TimeUnit.SECONDS.sleep(5);
System.out.printf("put values (%f sec.)%n", elapsedTime.getAsDouble());
deque.putLast("XXX");
deque.putLast("YYY");
deque.putLast("ZZZ");
TimeUnit.SECONDS.sleep(5);
System.out.println("future.cancel");
future.cancel(true);
}
// 結果
// ↓
//put values (0.002596 sec.)
// take ...
// take OK! : value = aaa (0.004495 sec.)
// take ...
// take OK! : value = bbb (0.004650 sec.)
// take ...
// take OK! : value = ccc (0.004762 sec.)
// take ...
//put values (5.012578 sec.)
// take OK! : value = XXX (5.012909 sec.)
// take ...
// take OK! : value = YYY (5.013045 sec.)
// take ...
// take OK! : value = ZZZ (5.013141 sec.)
// take ...
//future.cancel
// InterruptedException!
メソッド
boolean add (E e)
このメソッドは addLast(E e) と同等です。
API使用例はそちらをご参照ください。
void addFirst (E e)
// capacity = 3
final BlockingDeque<String> deque = new LinkedBlockingDeque<>(3);
System.out.println(deque); // []
deque.addFirst("aaa");
System.out.println(deque); // [aaa]
deque.addFirst("bbb");
System.out.println(deque); // [bbb, aaa]
deque.addFirst("ccc");
System.out.println(deque); // [ccc, bbb, aaa]
try {
deque.addFirst("ddd");
} catch (IllegalStateException e) {
System.out.println("IllegalStateException! : " + e.getMessage());
}
// 結果
// ↓
//IllegalStateException! : Deque full
void addLast (E e)
// capacity = 3
final BlockingDeque<String> deque = new LinkedBlockingDeque<>(3);
System.out.println(deque); // []
deque.addLast("aaa");
System.out.println(deque); // [aaa]
deque.addLast("bbb");
System.out.println(deque); // [aaa, bbb]
deque.addLast("ccc");
System.out.println(deque); // [aaa, bbb, ccc]
try {
deque.addLast("ddd");
} catch (IllegalStateException e) {
System.out.println("IllegalStateException! : " + e.getMessage());
}
// 結果
// ↓
//IllegalStateException! : Deque full
boolean contains (Object o)
final BlockingDeque<String> deque = new LinkedBlockingDeque<>();
System.out.println(deque.offerLast("aaa")); // true
System.out.println(deque.offerLast("bbb")); // true
System.out.println(deque.offerLast("ccc")); // true
System.out.println(deque); // [aaa, bbb, ccc]
System.out.println(deque.contains("aaa")); // true
System.out.println(deque.contains("bbb")); // true
System.out.println(deque.contains("XXX")); // false
E element ()
このメソッドは getFirst() と同等です。
final BlockingDeque<String> deque = new LinkedBlockingDeque<>();
System.out.println(deque); // []
System.out.println(deque.offerLast("aaa")); // true
System.out.println(deque.offerLast("bbb")); // true
System.out.println(deque.offerLast("ccc")); // true
System.out.println(deque.getFirst()); // aaa
System.out.println(deque); // [aaa, bbb, ccc]
System.out.println(deque.removeFirst()); // aaa
System.out.println(deque); // [bbb, ccc]
System.out.println(deque.getFirst()); // bbb
System.out.println(deque); // [bbb, ccc]
System.out.println(deque.removeFirst()); // bbb
System.out.println(deque); // [ccc]
System.out.println(deque.getFirst()); // ccc
System.out.println(deque); // [ccc]
System.out.println(deque.removeFirst()); // ccc
System.out.println(deque); // []
try {
deque.getFirst();
} catch (NoSuchElementException e) {
System.out.println("NoSuchElementException!");
}
// 結果
// ↓
//NoSuchElementException!
Iterator<E> iterator ()
final BlockingDeque<String> deque = new LinkedBlockingDeque<>();
System.out.println(deque.offerLast("aaa")); // true
System.out.println(deque.offerLast("bbb")); // true
System.out.println(deque.offerLast("ccc")); // true
System.out.println(deque); // [aaa, bbb, ccc]
final var iterator = deque.iterator();
System.out.println("-- forEachRemaining --");
iterator.forEachRemaining(System.out::println);
// 結果
// ↓
//-- forEachRemaining --
//aaa
//bbb
//ccc
boolean offer (E e)
このメソッドは offerLast(E e) と同等です。
API使用例はそちらをご参照ください。
boolean offer (E e, long timeout, TimeUnit unit)
このメソッドは offerLast(E e, long timeout, TimeUnit unit) と同等です。
API使用例はそちらをご参照ください。
boolean offerFirst (E e)
// capacity = 3
final BlockingDeque<String> deque = new LinkedBlockingDeque<>(3);
System.out.println(deque); // []
System.out.println(deque.offerFirst("aaa")); // true
System.out.println(deque); // [aaa]
System.out.println(deque.offerFirst("bbb")); // true
System.out.println(deque); // [bbb, aaa]
System.out.println(deque.offerFirst("ccc")); // true
System.out.println(deque); // [ccc, bbb, aaa]
System.out.println(deque.offerFirst("ddd")); // false
System.out.println(deque); // [ccc, bbb, aaa]
boolean offerFirst (E e, long timeout, TimeUnit unit)
// 基準となる時刻
final long current = System.nanoTime();
// 基準となる時刻からの差分を秒として取得
final DoubleSupplier elapsedTime = () -> (System.nanoTime() - current) / 1000000000.0;
try (final var executor = Executors.newSingleThreadExecutor()) {
final BlockingDeque<String> deque = new LinkedBlockingDeque<>(3);
System.out.printf("remainingCapacity = %d (%f sec.)%n",
deque.remainingCapacity(), elapsedTime.getAsDouble());
executor.submit(() -> {
try {
final var list = List.of("aaa", "bbb", "ccc", "ddd");
for (final var value : list) {
System.out.println(" offer ...");
final var ret = deque.offerFirst(value, 5, TimeUnit.SECONDS);
System.out.printf(" offer ret = %b (%f sec.)%n",
ret, elapsedTime.getAsDouble());
}
} catch (InterruptedException e) {
System.out.println(" InterruptedException!");
}
});
TimeUnit.SECONDS.sleep(10);
System.out.printf("deque = %s (%f sec.)%n", deque, elapsedTime.getAsDouble());
}
// 結果
// ↓
//remainingCapacity = 3 (0.001915 sec.)
// offer ...
// offer ret = true (0.004569 sec.)
// offer ...
// offer ret = true (0.004718 sec.)
// offer ...
// offer ret = true (0.004860 sec.)
// offer ...
// offer ret = false (5.006397 sec.)
//deque = [ccc, bbb, aaa] (10.004461 sec.)
boolean offerLast (E e)
// capacity = 3
final BlockingDeque<String> deque = new LinkedBlockingDeque<>(3);
System.out.println(deque); // []
System.out.println(deque.offerLast("aaa")); // true
System.out.println(deque); // [aaa]
System.out.println(deque.offerLast("bbb")); // true
System.out.println(deque); // [aaa, bbb]
System.out.println(deque.offerLast("ccc")); // true
System.out.println(deque); // [aaa, bbb, ccc]
System.out.println(deque.offerLast("ddd")); // false
System.out.println(deque); // [aaa, bbb, ccc]
boolean offerLast (E e, long timeout, TimeUnit unit)
// 基準となる時刻
final long current = System.nanoTime();
// 基準となる時刻からの差分を秒として取得
final DoubleSupplier elapsedTime = () -> (System.nanoTime() - current) / 1000000000.0;
try (final var executor = Executors.newSingleThreadExecutor()) {
final BlockingDeque<String> deque = new LinkedBlockingDeque<>(3);
System.out.printf("remainingCapacity = %d (%f sec.)%n",
deque.remainingCapacity(), elapsedTime.getAsDouble());
executor.submit(() -> {
try {
final var list = List.of("aaa", "bbb", "ccc", "ddd");
for (final var value : list) {
System.out.println(" offer ...");
final var ret = deque.offerLast(value, 5, TimeUnit.SECONDS);
System.out.printf(" offer ret = %b (%f sec.)%n",
ret, elapsedTime.getAsDouble());
}
} catch (InterruptedException e) {
System.out.println(" InterruptedException!");
}
});
TimeUnit.SECONDS.sleep(10);
System.out.printf("deque = %s (%f sec.)%n", deque, elapsedTime.getAsDouble());
}
// 結果
// ↓
//remainingCapacity = 3 (0.001915 sec.)
// offer ...
// offer ret = true (0.004569 sec.)
// offer ...
// offer ret = true (0.004718 sec.)
// offer ...
// offer ret = true (0.004860 sec.)
// offer ...
// offer ret = false (5.006397 sec.)
//deque = [aaa, bbb, ccc] (10.007953 sec.)
E peek ()
このメソッドは peekFirst() と同等です。
final BlockingDeque<String> deque = new LinkedBlockingDeque<>();
System.out.println(deque); // []
System.out.println(deque.offerLast("aaa")); // true
System.out.println(deque.offerLast("bbb")); // true
System.out.println(deque.offerLast("ccc")); // true
System.out.println(deque.peekFirst()); // aaa
System.out.println(deque); // [aaa, bbb, ccc]
System.out.println(deque.pollFirst()); // aaa
System.out.println(deque); // [bbb, ccc]
System.out.println(deque.peekFirst()); // bbb
System.out.println(deque); // [bbb, ccc]
System.out.println(deque.pollFirst()); // bbb
System.out.println(deque); // [ccc]
System.out.println(deque.peekFirst()); // ccc
System.out.println(deque); // [ccc]
System.out.println(deque.pollFirst()); // ccc
System.out.println(deque); // []
System.out.println(deque.peekFirst()); // null
System.out.println(deque); // []
E poll ()
このメソッドは pollFirst() と同等です。
final BlockingDeque<String> deque = new LinkedBlockingDeque<>();
System.out.println(deque); // []
System.out.println(deque.offerLast("aaa")); // true
System.out.println(deque.offerLast("bbb")); // true
System.out.println(deque.offerLast("ccc")); // true
System.out.println(deque); // [aaa, bbb, ccc]
System.out.println(deque.pollFirst()); // aaa
System.out.println(deque); // [bbb, ccc]
System.out.println(deque.pollFirst()); // bbb
System.out.println(deque); // [ccc]
System.out.println(deque.pollFirst()); // ccc
System.out.println(deque); // []
System.out.println(deque.pollFirst()); // null
System.out.println(deque); // []
E poll (long timeout, TimeUnit unit)
このメソッドは pollFirst(long timeout, TimeUnit unit) と同等です。
API使用例はそちらをご参照ください。
E pollFirst (long timeout, TimeUnit unit)
関連:poll()
// 基準となる時刻
final long current = System.nanoTime();
// 基準となる時刻からの差分を秒として取得
final DoubleSupplier elapsedTime = () -> (System.nanoTime() - current) / 1000000000.0;
try (final var executor = Executors.newSingleThreadExecutor()) {
final BlockingDeque<String> deque = new LinkedBlockingDeque<>();
System.out.printf("put values (%f sec.)%n", elapsedTime.getAsDouble());
deque.putLast("aaa");
deque.putLast("bbb");
deque.putLast("ccc");
final var future = executor.submit(() -> {
try {
while (true) {
System.out.println(" poll ...");
final var value = deque.pollFirst(5, TimeUnit.SECONDS);
System.out.printf(" poll value = %s (%f sec.)%n",
value, elapsedTime.getAsDouble());
}
} catch (InterruptedException e) {
System.out.println(" InterruptedException!");
}
});
TimeUnit.SECONDS.sleep(8);
System.out.println("future.cancel");
future.cancel(true);
}
// 結果
// ↓
//put values (0.002583 sec.)
// poll ...
// poll value = aaa (0.003982 sec.)
// poll ...
// poll value = bbb (0.004155 sec.)
// poll ...
// poll value = ccc (0.004282 sec.)
// poll ...
// poll value = null (5.007742 sec.)
// poll ...
//future.cancel
// InterruptedException!
E pollLast (long timeout, TimeUnit unit)
// 基準となる時刻
final long current = System.nanoTime();
// 基準となる時刻からの差分を秒として取得
final DoubleSupplier elapsedTime = () -> (System.nanoTime() - current) / 1000000000.0;
try (final var executor = Executors.newSingleThreadExecutor()) {
final BlockingDeque<String> deque = new LinkedBlockingDeque<>();
System.out.printf("put values (%f sec.)%n", elapsedTime.getAsDouble());
deque.putLast("aaa");
deque.putLast("bbb");
deque.putLast("ccc");
final var future = executor.submit(() -> {
try {
while (true) {
System.out.println(" poll ...");
final var value = deque.pollLast(5, TimeUnit.SECONDS);
System.out.printf(" poll value = %s (%f sec.)%n",
value, elapsedTime.getAsDouble());
}
} catch (InterruptedException e) {
System.out.println(" InterruptedException!");
}
});
TimeUnit.SECONDS.sleep(8);
System.out.println("future.cancel");
future.cancel(true);
}
// 結果
// ↓
//put values (0.002719 sec.)
// poll ...
// poll value = ccc (0.004141 sec.)
// poll ...
// poll value = bbb (0.004277 sec.)
// poll ...
// poll value = aaa (0.004409 sec.)
// poll ...
// poll value = null (5.006775 sec.)
// poll ...
//future.cancel
// InterruptedException!
void push (E e)
このメソッドは addFirst(E e) と同等です。
そちらのAPI使用例をご参照ください。
void put (E e)
このメソッドは putLast(E e) と同等です。
API使用例はそちらをご参照ください。
void putFirst (E e)
// 基準となる時刻
final long current = System.nanoTime();
// 基準となる時刻からの差分を秒として取得
final DoubleSupplier elapsedTime = () -> (System.nanoTime() - current) / 1000000000.0;
try (final var executor = Executors.newSingleThreadExecutor()) {
final BlockingDeque<String> deque = new LinkedBlockingDeque<>(3);
System.out.printf("remainingCapacity = %d (%f sec.)%n",
deque.remainingCapacity(), elapsedTime.getAsDouble());
final var future = executor.submit(() -> {
try {
final var list = List.of("aaa", "bbb", "ccc", "ddd");
for (final var value : list) {
System.out.println(" put ...");
deque.putFirst(value);
System.out.printf(" put OK! (%f sec.)%n", elapsedTime.getAsDouble());
}
} catch (InterruptedException e) {
System.out.printf(" InterruptedException! (%f sec.)%n", elapsedTime.getAsDouble());
}
});
TimeUnit.SECONDS.sleep(5);
System.out.printf("deque = %s (%f sec.)%n", deque, elapsedTime.getAsDouble());
System.out.println("future.cancel");
future.cancel(true);
}
// 結果
// ↓
//remainingCapacity = 3 (0.002041 sec.)
// put ...
// put OK! (0.004570 sec.)
// put ...
// put OK! (0.004671 sec.)
// put ...
// put OK! (0.004771 sec.)
// put ...
//deque = [ccc, bbb, aaa] (5.018881 sec.)
//future.cancel
// InterruptedException! (5.019745 sec.)
void putLast (E e)
// 基準となる時刻
final long current = System.nanoTime();
// 基準となる時刻からの差分を秒として取得
final DoubleSupplier elapsedTime = () -> (System.nanoTime() - current) / 1000000000.0;
try (final var executor = Executors.newSingleThreadExecutor()) {
final BlockingDeque<String> deque = new LinkedBlockingDeque<>(3);
System.out.printf("remainingCapacity = %d (%f sec.)%n",
deque.remainingCapacity(), elapsedTime.getAsDouble());
final var future = executor.submit(() -> {
try {
final var list = List.of("aaa", "bbb", "ccc", "ddd");
for (final var value : list) {
System.out.println(" put ...");
deque.putLast(value);
System.out.printf(" put OK! (%f sec.)%n", elapsedTime.getAsDouble());
}
} catch (InterruptedException e) {
System.out.printf(" InterruptedException! (%f sec.)%n", elapsedTime.getAsDouble());
}
});
TimeUnit.SECONDS.sleep(5);
System.out.printf("deque = %s (%f sec.)%n", deque, elapsedTime.getAsDouble());
System.out.println("future.cancel");
future.cancel(true);
}
// 結果
// ↓
//remainingCapacity = 3 (0.001776 sec.)
// put ...
// put OK! (0.004289 sec.)
// put ...
// put OK! (0.004391 sec.)
// put ...
// put OK! (0.004498 sec.)
// put ...
//deque = [aaa, bbb, ccc] (5.007701 sec.)
//future.cancel
// InterruptedException! (5.008613 sec.)
E remove ()
このメソッドは removeFirst() と同等です。
final BlockingDeque<String> deque = new LinkedBlockingDeque<>();
System.out.println(deque); // []
System.out.println(deque.offerLast("aaa")); // true
System.out.println(deque.offerLast("bbb")); // true
System.out.println(deque.offerLast("ccc")); // true
System.out.println(deque); // [aaa, bbb, ccc]
System.out.println(deque.removeFirst()); // aaa
System.out.println(deque); // [bbb, ccc]
System.out.println(deque.removeFirst()); // bbb
System.out.println(deque); // [ccc]
System.out.println(deque.removeFirst()); // ccc
System.out.println(deque); // []
try {
deque.removeFirst();
} catch (NoSuchElementException e) {
System.out.println("NoSuchElementException!");
}
// 結果
// ↓
//NoSuchElementException!
boolean remove (Object o)
このメソッドは removeFirstOccurrence(Object o) と同等です。
API使用例はそちらをご参照ください。
boolean removeFirstOccurrence (Object o)
final BlockingDeque<String> deque = new LinkedBlockingDeque<>();
System.out.println(deque.offerLast("aaa")); // true
System.out.println(deque.offerLast("BBB")); // true
System.out.println(deque.offerLast("aaa")); // true
System.out.println(deque.offerLast("BBB")); // true
System.out.println(deque.offerLast("ccc")); // true
System.out.println(deque); // [aaa, BBB, aaa, BBB, ccc]
System.out.println(deque.removeFirstOccurrence("aaa")); // true
System.out.println(deque); // [BBB, aaa, BBB, ccc]
System.out.println(deque.removeFirstOccurrence("BBB")); // true
System.out.println(deque); // [aaa, BBB, ccc]
System.out.println(deque.removeFirstOccurrence("XXX")); // false
System.out.println(deque); // [aaa, BBB, ccc]
boolean removeLastOccurrence (Object o)
final BlockingDeque<String> deque = new LinkedBlockingDeque<>();
System.out.println(deque.offerLast("aaa")); // true
System.out.println(deque.offerLast("BBB")); // true
System.out.println(deque.offerLast("aaa")); // true
System.out.println(deque.offerLast("BBB")); // true
System.out.println(deque.offerLast("ccc")); // true
System.out.println(deque); // [aaa, BBB, aaa, BBB, ccc]
System.out.println(deque.removeLastOccurrence("BBB")); // true
System.out.println(deque); // [aaa, BBB, aaa, ccc]
System.out.println(deque.removeLastOccurrence("aaa")); // true
System.out.println(deque); // [aaa, BBB, ccc]
System.out.println(deque.removeLastOccurrence("XXX")); // false
System.out.println(deque); // [aaa, BBB, ccc]
int size ()
final BlockingDeque<String> deque = new LinkedBlockingDeque<>();
System.out.println(deque); // []
System.out.println(deque.size()); // 0
System.out.println(deque.offerLast("aaa")); // true
System.out.println(deque); // [aaa]
System.out.println(deque.size()); // 1
System.out.println(deque.offerLast("bbb")); // true
System.out.println(deque); // [aaa, bbb]
System.out.println(deque.size()); // 2
System.out.println(deque.offerLast("ccc")); // true
System.out.println(deque); // [aaa, bbb, ccc]
System.out.println(deque.size()); // 3
E take ()
このメソッドは takeFirst() と同等です。
API使用例はそちらをご参照ください。
E takeFirst ()
// 基準となる時刻
final long current = System.nanoTime();
// 基準となる時刻からの差分を秒として取得
final DoubleSupplier elapsedTime = () -> (System.nanoTime() - current) / 1000000000.0;
try (final var executor = Executors.newSingleThreadExecutor()) {
final BlockingDeque<String> deque = new LinkedBlockingDeque<>();
final var future = executor.submit(() -> {
try {
while (true) {
System.out.println(" take ...");
final var value = deque.takeFirst();
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());
deque.putLast("aaa");
deque.putLast("bbb");
deque.putLast("ccc");
TimeUnit.SECONDS.sleep(5);
System.out.printf("put values (%f sec.)%n", elapsedTime.getAsDouble());
deque.putLast("XXX");
deque.putLast("YYY");
deque.putLast("ZZZ");
TimeUnit.SECONDS.sleep(5);
System.out.println("future.cancel");
future.cancel(true);
}
// 結果
// ↓
//put values (0.002596 sec.)
// take ...
// take OK! : value = aaa (0.004495 sec.)
// take ...
// take OK! : value = bbb (0.004650 sec.)
// take ...
// take OK! : value = ccc (0.004762 sec.)
// take ...
//put values (5.012578 sec.)
// take OK! : value = XXX (5.012909 sec.)
// take ...
// take OK! : value = YYY (5.013045 sec.)
// take ...
// take OK! : value = ZZZ (5.013141 sec.)
// take ...
//future.cancel
// InterruptedException!
E takeLast ()
// 基準となる時刻
final long current = System.nanoTime();
// 基準となる時刻からの差分を秒として取得
final DoubleSupplier elapsedTime = () -> (System.nanoTime() - current) / 1000000000.0;
try (final var executor = Executors.newSingleThreadExecutor()) {
final BlockingDeque<String> deque = new LinkedBlockingDeque<>();
System.out.printf("put values (%f sec.)%n", elapsedTime.getAsDouble());
deque.putLast("aaa");
deque.putLast("bbb");
deque.putLast("ccc");
final var future = executor.submit(() -> {
try {
while (true) {
System.out.println(" take ...");
final var value = deque.takeLast();
System.out.printf(" take OK! : value = %s (%f sec.)%n",
value, elapsedTime.getAsDouble());
}
} catch (InterruptedException e) {
System.out.println(" InterruptedException!");
}
});
TimeUnit.SECONDS.sleep(5);
System.out.printf("future.cancel (%f sec.)%n", elapsedTime.getAsDouble());
future.cancel(true);
}
// 結果
// ↓
//put values (0.002098 sec.)
// take ...
// take OK! : value = ccc (0.004629 sec.)
// take ...
// take OK! : value = bbb (0.004766 sec.)
// take ...
// take OK! : value = aaa (0.004897 sec.)
// take ...
//future.cancel (5.011561 sec.)
// InterruptedException!
BlockingQueueで宣言されたメソッド
drainTo, drainTo, remainingCapacity
「Java API 使用例 : BlockingQueue」をご参照ください。
Collectionで宣言されたメソッド
clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
「Java API 使用例 : Collection」をご参照ください。
Dequeで宣言されたメソッド
addAll, descendingIterator, getFirst, getLast, peekFirst, peekLast, pollFirst, pollLast, pop, removeFirst, removeLast
「Java API 使用例 : Deque」をご参照ください。
Iterableで宣言されたメソッド
forEach
「Java API 使用例 : Iterable」をご参照ください。
関連記事
- API 使用例
- 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 (同期)
- Object (オブジェクト)
- Runnable
- Semaphore (セマフォ)
- Thread (スレッド)
- ThreadGroup
- ThreadLocal
- TimeUnit