/** * Puts a value at an index. This will fill any unset indexes less than {@code index} with {@code null}. * * @param key the index at which to insert the value * @param value the value to insert * @return the value */ public Object put(final int key, final Object value) { while (key >= size()) { add(null); } set(key, value); return value; }
/** * Puts a value at an index. This will fill any unset indexes less than * <code>index</code> with <code>null</code>. * * @param key * the index at which to insert the value * @param v * the value to insert * @return the value */ public Object put(int key, Object v) { while (key >= size()) add(null); set(key, v); return v; }