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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.