/** @throws NullPointerException if the specified key is null */ public boolean remove(Object key, Object value) { Object val=get(key); boolean removed=val != null && value != null && val.equals(value); try { MethodCall call=new MethodCall(REMOVE_IF_EQUALS, key, value); disp.callRemoteMethods(null, call, call_options); } catch(Exception e) { throw new RuntimeException("remove(" + key + ", " + value + ") failed", e); } return removed; }
/** * @return the previous value associated with the specified key, or <tt>null</tt> if there was no mapping for the key * @throws NullPointerException if the specified key or value is null */ public V putIfAbsent(K key, V value) { V prev_val=get(key); try { MethodCall call=new MethodCall(PUT_IF_ABSENT, key, value); disp.callRemoteMethods(null, call, call_options); } catch(Exception e) { throw new RuntimeException("putIfAbsent(" + key + ", " + value + ") failed", e); } return prev_val; }
/** @throws NullPointerException if any of the arguments are null */ public boolean replace(K key, V oldValue, V newValue) { Object val=get(key); boolean replaced=val != null && oldValue != null && val.equals(oldValue); try { MethodCall call=new MethodCall(REPLACE_IF_EQUALS, key, oldValue, newValue); disp.callRemoteMethods(null, call, call_options); } catch(Exception e) { throw new RuntimeException("replace(" + key + ", " + oldValue + ", " + newValue + ") failed", e); } return replaced; }
/** * * * @return the previous value associated with the specified key, or * <tt>null</tt> if there was no mapping for the key * @throws NullPointerException * if the specified key or value is null */ public V replace(K key, V value) { V retval=get(key); try { MethodCall call=new MethodCall(REPLACE_IF_EXISTS, key, value); disp.callRemoteMethods(null, call, call_options); } catch(Exception e) { throw new RuntimeException("replace(" + key + ", " + value + ") failed", e); } return retval; }
/** * Removes the key (and its corresponding value) from this map. This method * does nothing if the key is not in the map. * * @param key * the key that needs to be removed * @return the previous value associated with <tt>key</tt>, or * <tt>null</tt> if there was no mapping for <tt>key</tt> * @throws NullPointerException * if the specified key is null */ public V remove(Object key) { V retval=get(key); try { MethodCall call=new MethodCall(REMOVE, key); disp.callRemoteMethods(null, call, call_options); } catch(Exception e) { throw new RuntimeException("remove(" + key + ") failed", e); } return retval; }
/** * Maps the specified key to the specified value in this table. Neither the key nor the value can be null. <p/> * <p> * The value can be retrieved by calling the <tt>get</tt> method with a key that is equal to the original key. * * @param key * key with which the specified value is to be associated * @param value * value 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> * @throws NullPointerException * if the specified key or value is null */ public V put(K key, V value) { V prev_val=get(key); try { MethodCall call=new MethodCall(PUT, key, value); disp.callRemoteMethods(null, call, call_options); } catch(Exception e) { throw new RuntimeException("put(" + key + ", " + value + ") failed", e); } return prev_val; }
Float val=map.get(stock_name); if(val != null) { value_field.setText(val.toString());
/** @throws NullPointerException if the specified key is null */ public boolean remove(Object key, Object value) { Object val=get(key); boolean removed=val != null && value != null && val.equals(value); try { MethodCall call=new MethodCall(REMOVE_IF_EQUALS, key, value); disp.callRemoteMethods(null, call, call_options); } catch(Exception e) { throw new RuntimeException("remove(" + key + ", " + value + ") failed", e); } return removed; }
/** @throws NullPointerException if any of the arguments are null */ public boolean replace(K key, V oldValue, V newValue) { Object val=get(key); boolean replaced=val != null && oldValue != null && val.equals(oldValue); try { MethodCall call=new MethodCall(REPLACE_IF_EQUALS, key, oldValue, newValue); disp.callRemoteMethods(null, call, call_options); } catch(Exception e) { throw new RuntimeException("replace(" + key + ", " + oldValue + ", " + newValue + ") failed", e); } return replaced; }
/** * @return the previous value associated with the specified key, or <tt>null</tt> if there was no mapping for the key * @throws NullPointerException if the specified key or value is null */ public V putIfAbsent(K key, V value) { V prev_val=get(key); try { MethodCall call=new MethodCall(PUT_IF_ABSENT, key, value); disp.callRemoteMethods(null, call, call_options); } catch(Exception e) { throw new RuntimeException("putIfAbsent(" + key + ", " + value + ") failed", e); } return prev_val; }
/** * * * @return the previous value associated with the specified key, or * <tt>null</tt> if there was no mapping for the key * @throws NullPointerException * if the specified key or value is null */ public V replace(K key, V value) { V retval=get(key); try { MethodCall call=new MethodCall(REPLACE_IF_EXISTS, key, value); disp.callRemoteMethods(null, call, call_options); } catch(Exception e) { throw new RuntimeException("replace(" + key + ", " + value + ") failed", e); } return retval; }
/** * Maps the specified key to the specified value in this table. Neither the key nor the value can be null. <p/> * <p> * The value can be retrieved by calling the <tt>get</tt> method with a key that is equal to the original key. * * @param key * key with which the specified value is to be associated * @param value * value 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> * @throws NullPointerException * if the specified key or value is null */ public V put(K key, V value) { V prev_val=get(key); try { MethodCall call=new MethodCall(PUT, key, value); disp.callRemoteMethods(null, call, call_options); } catch(Exception e) { throw new RuntimeException("put(" + key + ", " + value + ") failed", e); } return prev_val; }
/** * Removes the key (and its corresponding value) from this map. This method * does nothing if the key is not in the map. * * @param key * the key that needs to be removed * @return the previous value associated with <tt>key</tt>, or * <tt>null</tt> if there was no mapping for <tt>key</tt> * @throws NullPointerException * if the specified key is null */ public V remove(Object key) { V retval=get(key); try { MethodCall call=new MethodCall(REMOVE, key); disp.callRemoteMethods(null, call, call_options); } catch(Exception e) { throw new RuntimeException("remove(" + key + ") failed", e); } return retval; }
/** * Maps the specified key to the specified value in the hashtable. Neither of both parameters can be null * @param key - the hashtable key * @param value - the value * @return the previous value of the specified key in this hashtable, or null if it did not have one */ public V put(K key, V value) { V prev_val=get(key); if(send_message == true) { try { MethodCall call=new MethodCall((short)1, new Object[]{key, value}); disp.callRemoteMethods(null, call, update_mode, timeout); } catch(Exception e) { throw new RuntimeException("put(" + key + ", " + value + ") failed", e); } } else { _put(key, value); } return prev_val; }
/** * Removes the key (and its corresponding value) from the hashmap. * @param key - the key to be removed. * @return the value to which the key had been mapped in this hashtable, or null if the key did not have a mapping. */ public V remove(Object key) { V retval=get(key); //Changes done by <aos> //if true, propagate action to the group if(send_message == true) { try { MethodCall call=new MethodCall((short)3, new Object[]{key}); disp.callRemoteMethods(null, call, update_mode, timeout); } catch(Exception e) { throw new RuntimeException("remove(" + key + ") failed", e); } } else { _remove(key); //don't have to do retval = super.remove(..) as is done at the beginning } return retval; }
Float val=map.get(stock_name); if(val != null) { value_field.setText(val.toString());
.keySet()) { if (!new_view.getMembers().contains( this.containerAddressesHashMap.get(containerName))) {