This reference is for Processing 2.0+. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.
| Class | |
|---|---|
| Name | getIntArray() |
| Examples |
// The following short JSON file called "data.json" is parsed
// in the code below. It must be in the project's "data" folder.
//
// [ 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144 ]
JSONArray json;
void setup() {
json = loadJSONArray("data.json");
int[] values = json.getIntArray();
println(values);
}
// Sketch prints:
// [0] 0
// [1] 1
// [2] 1
// [3] 2
// [4] 3
// [5] 5
// [6] 8
// [7] 13
// [8] 21
// [9] 34
// [10] 55
// [11] 89
// [12] 144
|
| Description | Returns the entire JSONArray as an array of ints. (All values in the array must be of the int type.) |
| Syntax | .getIntArray() |
| Returns | int[] |
| Related | getStringArray() |
