Code example for ConcurrentHashMap

Methods: put

0
     *  
     * @param key 
     * @param value 
     */ 
    public Object setAttribute(final String key, final Object value) {
        return this.attributes.put(key, value);
    } 
 
 
    /** 
     * µ±keyµÄvalue²»´æÔÚµÄʱºò£¬¹ØÁªkeyµ½´«ÈëµÄvalue£¬´Ë²Ù×÷ÊÇÔ­×ӵĠ
     *  
     * @see java.util.concurrent.ConcurrentHashMap#putIfAbsent(Object, Object) 
     * @param key 
     * @param value 
     */ 
    public Object setAttributeIfAbsent(final String key, final Object value) {
        return this.attributes.putIfAbsent(key, value);
    }