/** * * @return the previous value associated with the specified key, or <tt>null</tt> if there was no * mapping for the key * @throws NullPointerException if the specified key or value is null */ public V replace(int key, V value) { if (value == null) throw new NullPointerException(); int hash = hash(key); return segmentFor(hash).replace(key, hash, value); }
/** * * @throws NullPointerException if any of the arguments are null */ public boolean replace(int key, V oldValue, V newValue) { if (oldValue == null || newValue == null) throw new NullPointerException(); int hash = hash(key); return segmentFor(hash).replace(key, hash, oldValue, newValue); }