Java ConcurrentHashMap getDoubleSafe(ConcurrentHashMap map, String key)

Here you can find the source of getDoubleSafe(ConcurrentHashMap map, String key)

Description

get Double Safe

License

Open Source License

Declaration

static double getDoubleSafe(ConcurrentHashMap<String, Double> map, String key) 

Method Source Code

//package com.java2s;

import java.util.concurrent.ConcurrentHashMap;

public class Main {
    static double getDoubleSafe(ConcurrentHashMap<String, Double> map, String key) {
        Double v = map.get(key);//from ww  w .  ja  v  a2 s .c  o  m
        if (v == null)
            return 0.0;
        else
            return v;
    }
}

Related

  1. createConcurrentHashMap()
  2. createConcurrentHashMap()
  3. getConcurrentHashMap()
  4. getMapSafe( ConcurrentHashMap> map, String key)
  5. max(ConcurrentHashMap map)
  6. ParseKeyValString(String keyValString, ConcurrentHashMap map)
  7. parseMap(String config, ConcurrentHashMap map)