MCPcopy Create free account
hub / github.com/benfry/processing4 / remove

Method remove

core/src/processing/data/FloatList.java:200–217  ·  view source on GitHub ↗

Remove an element from the specified index. @webref floatlist:method @webBrief Remove an element from the specified index

(int index)

Source from the content-addressed store, hash-verified

198 * @webBrief Remove an element from the specified index
199 */
200 public float remove(int index) {
201 if (index < 0 || index >= count) {
202 throw new ArrayIndexOutOfBoundsException(index);
203 }
204 float entry = data[index];
205// int[] outgoing = new int[count - 1];
206// System.arraycopy(data, 0, outgoing, 0, index);
207// count--;
208// System.arraycopy(data, index + 1, outgoing, 0, count - index);
209// data = outgoing;
210 // For most cases, this actually appears to be faster
211 // than arraycopy() on an array copying into itself.
212 for (int i = index; i < count-1; i++) {
213 data[i] = data[i+1];
214 }
215 count--;
216 return entry;
217 }
218
219
220 // Remove the first instance of a particular value,

Callers 2

removeValueMethod · 0.95
removeChoiceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected