mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 05:39:18 +01:00
add insert(index, item) for single elements
This commit is contained in:
@@ -299,6 +299,11 @@ public class FloatList implements Iterable<Float> {
|
||||
// }
|
||||
|
||||
|
||||
public void insert(int index, float value) {
|
||||
insert(index, new float[] { value });
|
||||
}
|
||||
|
||||
|
||||
// same as splice
|
||||
public void insert(int index, float[] values) {
|
||||
if (index < 0) {
|
||||
@@ -728,7 +733,8 @@ public class FloatList implements Iterable<Float> {
|
||||
|
||||
|
||||
/**
|
||||
* Copy as many values as possible into the specified array.
|
||||
* Copy values into the specified array. If the specified array is null or
|
||||
* not the same size, a new array will be allocated.
|
||||
* @param array
|
||||
*/
|
||||
public float[] array(float[] array) {
|
||||
|
||||
@@ -268,6 +268,11 @@ public class IntList implements Iterable<Integer> {
|
||||
// }
|
||||
|
||||
|
||||
public void insert(int index, int value) {
|
||||
insert(index, new int[] { value });
|
||||
}
|
||||
|
||||
|
||||
// same as splice
|
||||
public void insert(int index, int[] values) {
|
||||
if (index < 0) {
|
||||
@@ -673,7 +678,8 @@ public class IntList implements Iterable<Integer> {
|
||||
|
||||
|
||||
/**
|
||||
* Copy as many values as possible into the specified array.
|
||||
* Copy values into the specified array. If the specified array is null or
|
||||
* not the same size, a new array will be allocated.
|
||||
* @param array
|
||||
*/
|
||||
public int[] array(int[] array) {
|
||||
|
||||
@@ -307,6 +307,11 @@ public class StringList implements Iterable<String> {
|
||||
// }
|
||||
|
||||
|
||||
public void insert(int index, String value) {
|
||||
insert(index, new String[] { value });
|
||||
}
|
||||
|
||||
|
||||
// same as splice
|
||||
public void insert(int index, String[] values) {
|
||||
if (index < 0) {
|
||||
@@ -633,7 +638,8 @@ public class StringList implements Iterable<String> {
|
||||
|
||||
|
||||
/**
|
||||
* Copy as many values as possible into the specified array.
|
||||
* Copy values into the specified array. If the specified array is null or
|
||||
* not the same size, a new array will be allocated.
|
||||
* @param array
|
||||
*/
|
||||
public String[] array(String[] array) {
|
||||
|
||||
Reference in New Issue
Block a user