/** * Inserts a key/value pair into the map. * * @param key an <code>long</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(long key, V value) { int index = insertionIndex(key); 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>long</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(long key, V value) { int index = insertionIndex(key); if (index < 0) return _values[-index - 1]; return doPut(key, value, index); }