MCPcopy Index your code
hub / github.com/benfry/processing4 / splice

Method splice

core/src/processing/core/PApplet.java:7837–7845  ·  view source on GitHub ↗

Inserts a value or an array of values into an existing array. The first two parameters must be arrays of the same datatype. The first parameter specifies the initial array to be modified, and the second parameter defines the data to be inserted. The third parameter is an index value which specifies

(boolean[] list,
                                       boolean value, int index)

Source from the content-addressed store, hash-verified

7835 * @see PApplet#subset(boolean[], int, int)
7836 */
7837 static final public boolean[] splice(boolean[] list,
7838 boolean value, int index) {
7839 boolean[] outgoing = new boolean[list.length + 1];
7840 System.arraycopy(list, 0, outgoing, 0, index);
7841 outgoing[index] = value;
7842 System.arraycopy(list, index, outgoing, index + 1,
7843 list.length - index);
7844 return outgoing;
7845 }
7846
7847 static final public boolean[] splice(boolean[] list,
7848 boolean[] value, int index) {

Callers 1

insertColumnMethod · 0.95

Calls 3

arraycopyMethod · 0.80
setMethod · 0.65
getNameMethod · 0.45

Tested by

no test coverage detected