Code example for SortedMap

Methods: containsKey, get, put

0
//    synchronized public Map<String, String> getDefaults() { 
//        return defaults; 
//    } 
 
    synchronized public void putDefault(final String key, final String def) {
        if(!defaults.containsKey(key) || defaults.get(key) == null) {
            defaults.put(key, def);
        } else if(def != null && !defaults.get(key).equals(def)) {
            System.out.println("Defaults for " + key + " differ: " + def + " != " + defaults.get(key));
        } 
    } 
 
    synchronized public boolean getBoolean(final String key) {
        return false; // GWT fix 
//        putDefault(key, null); 
//        return properties.containsKey(key) ? Boolean.parseBoolean(properties.get(key)) : false; 
    } 
 
    synchronized public boolean getBoolean(final String key, final boolean def) {
        return def; // GWT fix
//        putDefault(key, Boolean.toString(def));