There's more...

ConcurrentHashMap has more methods than what's specified in the previous section. We enumerate some of them in the following list:

  • forEachKey() and forEachValue(): These methods are similar to the forEach() methods, but in this case, the expression processes the keys and values stored in ConcurrentHashMap, respectively.
  • searchEntries(), searchKeys(), and searchValues(): These methods are similar to the search() method explained before. However, in this case, the expression passed as a parameter receives an Entry object, a key, or a value of the elements stored in ConcurrentHashMap.
  • reduceEntries(), reduceKeys(), and reduceValues(): These methods are similar to the reduce() method explained before. However, in this case, the ...

Get Java 9 Concurrency Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.