/** * retrieves the value for <tt>key</tt> * * @param key an <code>int</code> value * @return the value of <tt>key</tt> or (int)0 if no such mapping exists. */ public V get(int key) { int index = index(key); return index < 0 ? null : _values[index]; }
/** * Deletes a key/value pair from the map. * * @param key an <code>int</code> value * @return an <code>Object</code> value or (int)0 if no such mapping exists. */ public V remove(int key) { V prev = null; int index = index(key); if (index >= 0) { prev = _values[index]; removeAt(index); // clear key,state; adjust size } return prev; }
public final boolean execute(int key, Object value) { int index = _otherMap.index(key); if (index >= 0 && eq(value, _otherMap.get(key))) { return true; } return false; }