Java Code Examples for java.util.concurrent.ConcurrentHashMap#reduceEntries()
The following examples show how to use
java.util.concurrent.ConcurrentHashMap#reduceEntries() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConcurrentHashMap8Test.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * reduceEntriesSequentially accumulates across all entries */ public void testReduceEntriesSequentially() { ConcurrentHashMap<Long, Long> m = longMap(); Map.Entry<Long,Long> r; r = m.reduceEntries(Long.MAX_VALUE, new AddKeys()); assertEquals(r.getKey().longValue(), (long)SIZE * (SIZE - 1) / 2); }
Example 2
Source File: ConcurrentHashMap8Test.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * reduceEntriesInParallel accumulate across all entries */ public void testReduceEntriesInParallel() { ConcurrentHashMap<Long, Long> m = longMap(); Map.Entry<Long,Long> r; r = m.reduceEntries(1L, new AddKeys()); assertEquals(r.getKey().longValue(), (long)SIZE * (SIZE - 1) / 2); }
Example 3
Source File: ConcurrentHashMap8Test.java From j2objc with Apache License 2.0 | 5 votes |
/** * reduceEntriesSequentially accumulates across all entries */ public void testReduceEntriesSequentially() { ConcurrentHashMap<Long, Long> m = longMap(); Map.Entry<Long,Long> r; r = m.reduceEntries(Long.MAX_VALUE, new AddKeys()); assertEquals(r.getKey().longValue(), (long)SIZE * (SIZE - 1) / 2); }
Example 4
Source File: ConcurrentHashMap8Test.java From j2objc with Apache License 2.0 | 5 votes |
/** * reduceEntriesInParallel accumulate across all entries */ public void testReduceEntriesInParallel() { ConcurrentHashMap<Long, Long> m = longMap(); Map.Entry<Long,Long> r; r = m.reduceEntries(1L, new AddKeys()); assertEquals(r.getKey().longValue(), (long)SIZE * (SIZE - 1) / 2); }