/** * 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 null if none was found. */ public final Object put(Object key, Object value) { if (null == key) { throw new NullPointerException("null keys not supported"); } Object previous = null; Object oldKey = null; int index = insertionIndex(key); if (index < 0) { index = -index -1; previous = _values[index]; } oldKey = _set[index]; _set[index] = key; _values[index] = value; if (null == previous) { postInsertHook(oldKey == null); } return previous; }