/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or {@code null} if none was found. */ public V put(K key, V value) { // insertKey() inserts the key if a slot if found and returns the index int index = insertKey(key); return doPut(value, index); }
/** * Inserts a key/value pair into the map if the specified key is not already * associated with a value. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or {@code null} if none was found. */ public V putIfAbsent(K key, V value) { // insertKey() inserts the key if a slot if found and returns the index int index = insertKey(key); if (index < 0) { return _values[-index - 1]; } return doPut(value, index); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or {@code null} if none was found. */ public V put( K key, V value ) { int index = insertionIndex( key ); return doPut( key, value, index ); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or {@code null} if none was found. */ public V put(K key, V value) { // insertKey() inserts the key if a slot if found and returns the index int index = insertKey(key); return doPut(value, index); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or {@code null} if none was found. */ @Override public V put(K key, V value) { // insertKey() inserts the key if a slot if found and returns the index int index = insertKey(key); return doPut(value, index); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or {@code null} if none was found. */ public V put(K key, V value) { // insertKey() inserts the key if a slot if found and returns the index int index = insertKey(key); return doPut(value, index); }
/** * Inserts a key/value pair into the map if the specified key is not already * associated with a value. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or {@code null} if none was found. */ public V putIfAbsent(K key, V value) { // insertKey() inserts the key if a slot if found and returns the index int index = insertKey(key); if (index < 0) { return _values[-index - 1]; } return doPut(value, index); }
/** * Inserts a key/value pair into the map if the specified key is not already * associated with a value. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or {@code null} if none was found. */ @Override public V putIfAbsent(K key, V value) { // insertKey() inserts the key if a slot if found and returns the index int index = insertKey(key); if (index < 0) { return _values[-index - 1]; } return doPut(value, index); }
/** * Inserts a key/value pair into the map if the specified key is not already * associated with a value. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or {@code null} if none was found. */ public V putIfAbsent( K key, V value ) { int index = insertionIndex( key ); if ( index < 0 ) { return _values[-index - 1]; } return doPut( key, value, index ); }
/** * Inserts a key/value pair into the map if the specified key is not already * associated with a value. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or {@code null} if none was found. */ public V putIfAbsent(K key, V value) { // insertKey() inserts the key if a slot if found and returns the index int index = insertKey(key); if (index < 0) { return _values[-index - 1]; } return doPut(value, index); }