/** * Inserts a key/value pair into the map. * * @param key an <code>int</code> value * @param value an <code>double</code> value * @return the previous value associated with <tt>key</tt>, * or (double)0 if none was found. */ public double put(int key, double value) { byte previousState; double previous = 0; int index = insertionIndex(key); boolean isNewMapping = true; if (index < 0) { index = -index -1; previous = _values[index]; isNewMapping = false; } previousState = _states[index]; _set[index] = key; _states[index] = FULL; _values[index] = value; if (isNewMapping) { postInsertHook(previousState == FREE); } return previous; }