Code example for TreeMap

Methods: get, put

0
            throw new NullPointerException("pair == null");
        } 
 
        CstUtf8 name = pair.getName();
 
        if (elements.get(name) != null) {
            throw new IllegalArgumentException("name already added: " + name);
        } 
         
        elements.put(name, pair);
    } 
 
    /** 
     * Gets the set of name-value pairs contained in this instance. The 
     * result is always unmodifiable. 
     *  
     * @return {@code non-null;} the set of name-value pairs 
     */ 
    public Collection<NameValuePair> getNameValuePairs() {
        return Collections.unmodifiableCollection(elements.values());
    }