/** * Associates the specified value with the specified key in this map. * The values is a simple Java object. If the map previously contained a mapping for * the key, the old value is replaced by the specified value. * * @param key the key with which the specified value is to be associated * @param value a simple Java object to be associated with the specified key * @return the previous value associated with <tt>key</tt>, or * <tt>null</tt> if there was no mapping for <tt>key</tt>. */ public V put (K key, V value) { return put(null, key, value); }
/** * Associates the specified value with the specified key in this map. * The values is a simple Java object. If the map previously contained a mapping for * the key, the old value is replaced by the specified value. * * @param key the key with which the specified value is to be associated * @param value a simple Java object to be associated with the specified key * @return the previous value associated with <tt>key</tt>, or * <tt>null</tt> if there was no mapping for <tt>key</tt>. */ @Override public Object put(String key, Object value) { return put(null, key, value); }
/** * Associates the specified value with the specified key in this map. * The values is a simple Java object. If the map previously contained a mapping for * the key, the old value is replaced by the specified value. * * @param key the key with which the specified value is to be associated * @param value a simple Java object to be associated with the specified key * @return the previous value associated with <tt>key</tt>, or * <tt>null</tt> if there was no mapping for <tt>key</tt>. */ public V put (K key, V value) { return put(null, key, value); }
/** * Associates the specified value with the specified key in this map. * The values is a simple Java object. If the map previously contained a mapping for * the key, the old value is replaced by the specified value. * * @param key the key with which the specified value is to be associated * @param value a simple Java object to be associated with the specified key * @return the previous value associated with <tt>key</tt>, or * <tt>null</tt> if there was no mapping for <tt>key</tt>. */ @Override public Object put(String key, Object value) { return put(null, key, value); }
/** * Associates the specified value with the specified key in a * variable map. This key-value pair is injected to a top level of runtime * during evaluation. If the map previously contained a mapping for the key, * the old value is replaced. The key must be a valid Ruby variable or * constant name. It will be a top level variable or constant. * * @param key is a key that the specified value is to be associated with * @param value is a value to be associated with the specified key * @return a previous value associated with a key, or null if there was * no mapping for this key. */ public Object put(String key, Object value) { return provider.getVarMap().put(key, value); }
/** * Associates the specified value with the specified key in a * variable map. This key-value pair is injected to a top level of runtime * during evaluation. If the map previously contained a mapping for the key, * the old value is replaced. The key must be a valid Ruby variable or * constant name. It will be a top level variable or constant. * * @param key is a key that the specified value is to be associated with * @param value is a value to be associated with the specified key * @return a previous value associated with a key, or null if there was * no mapping for this key. */ public Object put(String key, Object value) { return provider.getVarMap().put(key, value); }
/** * Associates the specified value with the specified key in a variable map. * This key-value pair is injected to a given receiver during evaluation. * If the map previously contained a mapping for the key, * the old value is replaced. The key must be a valid Ruby variable or * constant name. A given receiver limits the scope of a variable or constant. * However, a global variable is accessible globally always. * * @param receiver a receiver to put the value in * @param key is a key that the specified value is to be associated with * @param value is a value to be associated with the specified key * @return a previous value associated with a key, or null if there was * no mapping for this key. */ public Object put(Object receiver, String key, Object value) { return provider.getVarMap().put(receiver, key, value); }
/** * Associates the specified value with the specified key in a * variable map. This key-value pair is injected to a top level of runtime * during evaluation. If the map previously contained a mapping for the key, * the old value is replaced. The key must be a valid Ruby variable or * constant name. It will be a top level variable or constant. * * @param key is a key that the specified value is to be associated with * @param value is a value to be associated with the specified key * @return a previous value associated with a key, or null if there was * no mapping for this key. */ public Object put(String key, Object value) { return provider.getVarMap().put(key, value); }
/** * Associates the specified value with the specified key in a variable map. * This key-value pair is injected to a given receiver during evaluation. * If the map previously contained a mapping for the key, * the old value is replaced. The key must be a valid Ruby variable or * constant name. A given receiver limits the scope of a variable or constant. * However, a global variable is accessible globally always. * * @param receiver a receiver to put the value in * @param key is a key that the specified value is to be associated with * @param value is a value to be associated with the specified key * @return a previous value associated with a key, or null if there was * no mapping for this key. */ public Object put(Object receiver, String key, Object value) { return provider.getVarMap().put(receiver, key, value); }
/** * Associates the specified value with the specified key in a * variable map. This key-value pair is injected to a top level of runtime * during evaluation. If the map previously contained a mapping for the key, * the old value is replaced. The key must be a valid Ruby variable or * constant name. It will be a top level variable or constant. * * @param key is a key that the specified value is to be associated with * @param value is a value to be associated with the specified key * @return a previous value associated with a key, or null if there was * no mapping for this key. */ public Object put(String key, Object value) { return provider.getVarMap().put(key, value); }
/** * Copies all of the mappings from the specified map to this map. * * @param t mappings to be stored in this map */ @Override public void putAll(final Map<? extends String, ? extends Object> map) { if (map == null) { throw new NullPointerException("map is null"); } if (map.isEmpty()) { throw new IllegalArgumentException("map is empty"); } for ( final Entry entry : map.entrySet() ) { final Object key = entry.getKey(); if (key instanceof String) { put( (String) key, entry.getValue()); } else { throw new ClassCastException("key is not String"); } } }
/** * Copies all of the mappings from the specified map to this map. * * @param t mappings to be stored in this map */ @Override public void putAll(final Map<? extends String, ? extends Object> map) { if (map == null) { throw new NullPointerException("map is null"); } if (map.isEmpty()) { throw new IllegalArgumentException("map is empty"); } for ( final Entry entry : map.entrySet() ) { final Object key = entry.getKey(); if (key instanceof String) { put( (String) key, entry.getValue()); } else { throw new ClassCastException("key is not String"); } } }
/** * Associates the specified value with the specified key in a variable map. * This key-value pair is injected to a given receiver during evaluation. * If the map previously contained a mapping for the key, * the old value is replaced. The key must be a valid Ruby variable or * constant name. A given receiver limits the scope of a variable or constant. * However, a global variable is accessible globally always. * * @param receiver a receiver to put the value in * @param key is a key that the specified value is to be associated with * @param value is a value to be associated with the specified key * @return a previous value associated with a key, or null if there was * no mapping for this key. */ public Object put(Object receiver, String key, Object value) { return provider.getVarMap().put(receiver, key, value); }
/** * Associates the specified value with the specified key in a variable map. * This key-value pair is injected to a given receiver during evaluation. * If the map previously contained a mapping for the key, * the old value is replaced. The key must be a valid Ruby variable or * constant name. A given receiver limits the scope of a variable or constant. * However, a global variable is accessible globally always. * * @param receiver a receiver to put the value in * @param key is a key that the specified value is to be associated with * @param value is a value to be associated with the specified key * @return a previous value associated with a key, or null if there was * no mapping for this key. */ public Object put(Object receiver, String key, Object value) { return provider.getVarMap().put(receiver, key, value); }
/** * Copies all of the mappings from the specified map to this map. * * @param t mappings to be stored in this map */ public void putAll(Map<? extends K, ? extends V> t) { if (t == null) { throw new NullPointerException("map is null"); } if (t.isEmpty()) { throw new IllegalArgumentException("map is empty"); } Set set = t.entrySet(); Iterator itr = set.iterator(); while (itr.hasNext()) { Map.Entry entry = (Map.Entry)itr.next(); if (entry.getKey() instanceof String) { K key = (K)entry.getKey(); V value = (V)entry.getValue(); put(key, value); } else { throw new ClassCastException("key is NOT String"); } } }
/** * Copies all of the mappings from the specified map to this map. * * @param t mappings to be stored in this map */ public void putAll(Map<? extends K, ? extends V> t) { if (t == null) { throw new NullPointerException("map is null"); } if (t.isEmpty()) { throw new IllegalArgumentException("map is empty"); } Set set = t.entrySet(); Iterator itr = set.iterator(); while (itr.hasNext()) { Map.Entry entry = (Map.Entry)itr.next(); if (entry.getKey() instanceof String) { K key = (K)entry.getKey(); V value = (V)entry.getValue(); put(key, value); } else { throw new ClassCastException("key is NOT String"); } } }