List of utility methods to do ConcurrentHashMap
ConcurrentHashMap | createConcurrentHashMap() create Concurrent Hash Map return new ConcurrentHashMap<K, V>(); |
ConcurrentHashMap | createConcurrentHashMap() Creates a concurrent map with lesser segements to save memory. return createConcurrentHashMap(16);
|
Map | getConcurrentHashMap() get Concurrent Hash Map return Collections.synchronizedMap(new ConcurrentHashMap<K, V>()); |
double | getDoubleSafe(ConcurrentHashMap get Double Safe Double v = map.get(key); if (v == null) return 0.0; else return v; |
ConcurrentHashMap | getMapSafe( ConcurrentHashMap get Map Safe ConcurrentHashMap<String, Double> map2 = map.get(key); if (map2 == null) { map2 = new ConcurrentHashMap<String, Double>(); map.put(key, map2); return map2; |
Map.Entry | max(ConcurrentHashMap max return map.reduceEntries(10, (e1, e2) -> { return e1.getValue() > e2.getValue() ? e1 : e2; }); |
void | ParseKeyValString(String keyValString, ConcurrentHashMap Parse Key Val String if (!keyValString.startsWith("#") && !keyValString.startsWith("//") && !keyValString.startsWith(" for (i = 0; i < keyValString.length(); ++i) { char cur = keyValString.charAt(i); if (cur == ' ' || cur == '\t' || cur == '=') { i++; break; sb.append(cur); ... |
void | parseMap(String config, ConcurrentHashMap parse Map StringTokenizer tupleTokenizer = new StringTokenizer(config, "/"); while (tupleTokenizer.hasMoreTokens()) { String tuple = tupleTokenizer.nextToken(); StringTokenizer commaTokenizer = new StringTokenizer(tuple, ","); if (commaTokenizer.countTokens() != 2) { throw new Exception("parsing Map, wrong format!"); String key = commaTokenizer.nextToken(); ... |
V | putIfAbsent(ConcurrentHashMap put If Absent if (col.containsKey(key) == false) { col.put(key, val); return col.get(key); |
void | setFieldValue(Object value, ConcurrentHashMap fieldHolder, String name, String desc) set Field Value fieldHolder.put(getFieldKey(name, desc), value); |