filmov
tv
Concurrent vs. Non-Concurrent Set Collectors for Java Sequential and Parallel Streams (Part 2)

Показать описание
This video walks through the implementation of ConcurrentSetCollector, which is a generic custom concurrent collector that accumulates input elements of type T into a ConcurrentHashMap.KeySetValue parameterized with a K type and returns a type S that extends Set, which enables the resulting Set to produce the elements in sorted order. The ConcurrentSetCollector is used in an example that creates Java HashSet and TreeSet objects that count the number of unique words in the complete works of William Shakespeare.