-
-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy pathIntDict_valueArray.xml
More file actions
executable file
·40 lines (31 loc) · 919 Bytes
/
IntDict_valueArray.xml
File metadata and controls
executable file
·40 lines (31 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>valueArray()</name>
<category>IntDict</category>
<subcategory>Method</subcategory>
<type>method</type>
<example>
<image></image>
<code><![CDATA[
IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
inventory.set("cd", 84);
inventory.set("tapes", 15);
inventory.set("records", 102);
println(inventory);
int[] amounts = inventory.valueArray();
println(amounts);
}
]]></code>
</example>
<description><![CDATA[
The version of this method without a parameter creates a new
array and copies each of the values into it. The version with
the <b>int[]</b> parameters fills an already-allocated array with the
values (more efficient than creating a new array each time).
If 'array' is null, or not the same size as the number of values,
a new array will be allocated and returned.
]]></description>
</root>