MCPcopy Create free account
hub / github.com/SquirrelJME/SquirrelJME / remove

Method remove

runt/apis/cldc-compact/java/util/ArrayList.java:215–238  ·  view source on GitHub ↗

{@inheritDoc} @since 2018/12/12

(int __i)

Source from the content-addressed store, hash-verified

213 * @since 2018/12/12
214 */
215 @Override
216 public E remove(int __i)
217 throws IndexOutOfBoundsException
218 {
219 // Out of bounds?
220 int size = this._size;
221 if (__i < 0 || __i >= size)
222 throw new IndexOutOfBoundsException("IOOB");
223
224 // Get the old element first
225 E[] elements = this._elements;
226 E rv = elements[__i];
227
228 // Copy all of the elements down
229 for (int o = __i, i = __i + 1; i < size; o++, i++)
230 elements[o] = elements[i];
231 elements[size - 1] = null;
232
233 // Set new size
234 this._size = size - 1;
235
236 // And the old element
237 return rv;
238 }
239
240 @Override
241 protected void removeRange(int __a, int __b)

Callers 2

runMethod · 0.95
mainMethod · 0.95

Calls

no outgoing calls

Tested by 1

mainMethod · 0.76