ConcurrentHashMap in Java 8 http://ift.tt/2e7dg4J...

Please Visit: http://ift.tt/1ajReyV

ConcurrentHashMap in Java 8
http://ift.tt/2euM7GW
http://ift.tt/1EpUZCw
http://ift.tt/2euJPro

ConcurrentHashMap<String, MyClass> m =
new ConcurrentHashMap<String, MyClass>(8, 0.9f, 1);

public void mergeValue_jdk8(String word, int occurrence) {
wordMap.merge(word, occurrence, (key, value) -> wordMap.getOrDefault(key, 0) + value);
}

ConcurrentHashMap<String, Integer> wordMap = new ConcurrentHashMap<String, Integer>(16, 0.9f, 1);
wordMap.merge(word, occurrence, (key, value) -> wordMap.getOrDefault(key, 0) + value);
wordMap.reduceValues(1,(count1,count2) -> count1+count2);



from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/2euOoSv
via LifeLong Community

No comments:

Post a Comment