Skip to content

Commit 7a5085b

Browse files
committed
Modifications to Data classes for Reference entries
1 parent 06e6e70 commit 7a5085b

File tree

13 files changed

+222
-41
lines changed

13 files changed

+222
-41
lines changed

core/src/processing/core/PApplet.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6037,7 +6037,6 @@ header[17] image descriptor (packed bits)
60376037
* @webref input:files
60386038
* @param filename name of a file in the data folder or a URL.
60396039
* @see XML
6040-
* @see PApplet#createXML(String)
60416040
* @see PApplet#parseXML(String)
60426041
* @see PApplet#saveXML(XML, String)
60436042
* @see PApplet#loadBytes(String)
@@ -6069,7 +6068,6 @@ public XML loadXML(String filename, String options) {
60696068
* @param data the content to be parsed as XML
60706069
* @return an XML object, or null
60716070
* @see XML
6072-
* @see PApplet#createXML(String)
60736071
* @see PApplet#loadXML(String)
60746072
* @see PApplet#saveXML(XML, String)
60756073
*/
@@ -6093,7 +6091,6 @@ public XML parseXML(String xmlString, String options) {
60936091
* @param xml the XML object to save to disk
60946092
* @param filename name of the file to write to
60956093
* @see XML
6096-
* @see PApplet#createXML(String)
60976094
* @see PApplet#loadXML(String)
60986095
* @see PApplet#parseXML(String)
60996096
*/
@@ -6111,12 +6108,16 @@ public JSONObject parseJSONObject(String input) {
61116108
return new JSONObject(new StringReader(input));
61126109
}
61136110

6114-
6111+
/**
6112+
* @webref output:files
6113+
*/
61156114
public JSONObject loadJSONObject(String filename) {
61166115
return new JSONObject(createReader(filename));
61176116
}
61186117

6119-
6118+
/**
6119+
* @webref output:files
6120+
*/
61206121
public boolean saveJSONObject(JSONObject json, String filename) {
61216122
return saveJSONObject(json, filename, null);
61226123
}
@@ -6131,12 +6132,16 @@ public JSONArray parseJSONArray(String input) {
61316132
return new JSONArray(new StringReader(input));
61326133
}
61336134

6134-
6135+
/**
6136+
* @webref output:files
6137+
*/
61356138
public JSONArray loadJSONArray(String filename) {
61366139
return new JSONArray(createReader(filename));
61376140
}
61386141

6139-
6142+
/**
6143+
* @webref output:files
6144+
*/
61406145
public boolean saveJSONArray(JSONArray json, String filename) {
61416146
return saveJSONArray(json, filename);
61426147
}
@@ -6163,7 +6168,6 @@ public boolean saveJSONArray(JSONArray json, String filename, String options) {
61636168
* @webref input:files
61646169
* @param filename name of a file in the data folder or a URL.
61656170
* @see Table
6166-
* @see PApplet#createTable()
61676171
* @see PApplet#saveTable(Table, String)
61686172
* @see PApplet#loadBytes(String)
61696173
* @see PApplet#loadStrings(String)
@@ -6204,7 +6208,6 @@ public Table loadTable(String filename, String options) {
62046208
* @param table the Table object to save to a file
62056209
* @param filename the filename to which the Table should be saved
62066210
* @see Table
6207-
* @see PApplet#createTable()
62086211
* @see PApplet#loadTable(String)
62096212
*/
62106213
public boolean saveTable(Table table, String filename) {

core/src/processing/data/FloatDict.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
/**
1111
* A simple table class to use a String as a lookup for an float value.
12+
*
13+
* @webref data:composite
1214
*/
1315
public class FloatDict {
1416

core/src/processing/data/FloatList.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
import processing.core.PApplet;
88

99

10+
/**
11+
* @webref data:composite
12+
*/
1013
public class FloatList implements Iterable<Float> {
1114
int count;
1215
float[] data;

core/src/processing/data/IntDict.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
/**
1111
* A simple class to use a String as a lookup for an int value.
12+
*
13+
* @webref data:composite
1214
*/
1315
public class IntDict {
1416

core/src/processing/data/IntList.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Helper class for a list of ints. By design (for efficiency), functions like
1717
* sort() and shuffle() always act on the list itself. To get a sorted copy,
1818
* use list.copy().sort().
19+
* @webref data:composite
1920
*/
2021
public class IntList implements Iterable<Integer> {
2122
protected int count;

core/src/processing/data/JSONArray.java

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ of this software and associated documentation files (the "Software"), to deal
9191
*
9292
* @author JSON.org
9393
* @version 2012-11-13
94+
* @webref data:composite
9495
*/
9596
public class JSONArray {
9697

@@ -258,6 +259,8 @@ private Object get(int index) {
258259
* @param index The index must be between 0 and length() - 1.
259260
* @return A string value.
260261
* @throws JSONException If there is no string value for the index.
262+
* @webref jsonarray:method
263+
* @brief Get the string associated with an index
261264
*/
262265
public String getString(int index) {
263266
Object object = this.get(index);
@@ -274,6 +277,8 @@ public String getString(int index) {
274277
* @param index The index must be between 0 and length() - 1.
275278
* @return The value.
276279
* @throws JSONException If the key is not found or if the value is not a number.
280+
* @webref jsonarray:method
281+
* @brief Get the int value associated with an index
277282
*/
278283
public int getInt(int index) {
279284
Object object = this.get(index);
@@ -310,6 +315,9 @@ public long getLong(int index) {
310315
/**
311316
* Get a value from an index as a float. JSON uses 'double' values
312317
* internally, so this is simply getDouble() cast to a float.
318+
*
319+
* @webref jsonarray:method
320+
* @brief To come...
313321
*/
314322
public float getFloat(int index) {
315323
return (float) getDouble(index);
@@ -344,6 +352,8 @@ public double getDouble(int index) {
344352
* @return The truth.
345353
* @throws JSONException If there is no value for the index or if the
346354
* value is not convertible to boolean.
355+
* @webref jsonarray:method
356+
* @brief Get the boolean value associated with an index
347357
*/
348358
public boolean getBoolean(int index) {
349359
Object object = this.get(index);
@@ -362,10 +372,13 @@ public boolean getBoolean(int index) {
362372

363373
/**
364374
* Get the JSONArray associated with an index.
375+
*
365376
* @param index The index must be between 0 and length() - 1.
366377
* @return A JSONArray value.
367378
* @throws JSONException If there is no value for the index. or if the
368379
* value is not a JSONArray
380+
* @webref jsonarray:method
381+
* @brief Get the JSONArray associated with an index
369382
*/
370383
public JSONArray getJSONArray(int index) {
371384
Object object = this.get(index);
@@ -378,10 +391,13 @@ public JSONArray getJSONArray(int index) {
378391

379392
/**
380393
* Get the JSONObject associated with an index.
394+
*
381395
* @param index subscript
382396
* @return A JSONObject value.
383397
* @throws JSONException If there is no value for the index or if the
384398
* value is not a JSONObject
399+
* @webref jsonarray:method
400+
* @brief Get the JSONObject associated with an index
385401
*/
386402
public JSONObject getJSONObject(int index) {
387403
Object object = this.get(index);
@@ -392,7 +408,12 @@ public JSONObject getJSONObject(int index) {
392408
}
393409

394410

395-
/** Get this entire array as a String array. */
411+
/**
412+
* Get this entire array as a String array.
413+
*
414+
* @webref jsonarray:method
415+
* @brief Get this entire array as a String array
416+
*/
396417
public String[] getStringArray() {
397418
String[] outgoing = new String[size()];
398419
for (int i = 0; i < size(); i++) {
@@ -402,7 +423,12 @@ public String[] getStringArray() {
402423
}
403424

404425

405-
/** Get this entire array as an int array. Everything must be an int. */
426+
/**
427+
* Get this entire array as an int array. Everything must be an int.
428+
*
429+
* @webref jsonarray:method
430+
* @brief Get this entire array as an int array
431+
*/
406432
public int[] getIntArray() {
407433
int[] outgoing = new int[size()];
408434
for (int i = 0; i < size(); i++) {
@@ -634,6 +660,8 @@ public boolean[] getBooleanArray() {
634660
*
635661
* @param value A String value.
636662
* @return this.
663+
* @webref jsonarray:method
664+
* @brief Append an String value. This increases the array's length by one.
637665
*/
638666
public JSONArray append(String value) {
639667
this.append((Object)value);
@@ -777,6 +805,8 @@ protected JSONArray append(Object value) {
777805
* @param value A String value.
778806
* @return this.
779807
* @throws JSONException If the index is negative.
808+
* @webref jsonarray:method
809+
* @brief Put or replace a String value
780810
*/
781811
public JSONArray setString(int index, String value) {
782812
this.set(index, value);
@@ -792,6 +822,8 @@ public JSONArray setString(int index, String value) {
792822
* @param value An int value.
793823
* @return this.
794824
* @throws JSONException If the index is negative.
825+
* @webref jsonarray:method
826+
* @brief Put or replace an int value
795827
*/
796828
public JSONArray setInt(int index, int value) {
797829
this.set(index, new Integer(value));
@@ -823,6 +855,8 @@ public JSONArray setLong(int index, long value) {
823855
* @return this.
824856
* @throws RuntimeException If the index is negative or if the value is
825857
* not finite.
858+
* @webref jsonarray:method
859+
* @brief Put or replace a float value
826860
*/
827861
public JSONArray setFloat(int index, float value) {
828862
return setDouble(index, value);
@@ -852,6 +886,8 @@ public JSONArray setDouble(int index, double value) {
852886
* @param value A boolean value.
853887
* @return this.
854888
* @throws JSONException If the index is negative.
889+
* @webref jsonarray:method
890+
* @brief Put or replace a boolean value
855891
*/
856892
public JSONArray setBoolean(int index, boolean value) {
857893
return set(index, value ? Boolean.TRUE : Boolean.FALSE);
@@ -872,13 +908,19 @@ public JSONArray setBoolean(int index, boolean value) {
872908
// return this;
873909
// }
874910

875-
911+
/**
912+
* @webref jsonarray:method
913+
* @brief To come...
914+
*/
876915
public JSONArray setJSONArray(int index, JSONArray value) {
877916
set(index, value);
878917
return this;
879918
}
880919

881-
920+
/**
921+
* @webref jsonarray:method
922+
* @brief To come...
923+
*/
882924
public JSONArray setJSONObject(int index, JSONObject value) {
883925
set(index, value);
884926
return this;
@@ -918,6 +960,8 @@ private JSONArray set(int index, Object value) {
918960
* Get the number of elements in the JSONArray, included nulls.
919961
*
920962
* @return The length (or size).
963+
* @webref jsonarray:method
964+
* @brief Get the number of elements in the JSONArray, included nulls
921965
*/
922966
public int size() {
923967
return myArrayList.size();
@@ -937,9 +981,12 @@ protected boolean isNull(int index) {
937981

938982
/**
939983
* Remove an index and close the hole.
984+
*
940985
* @param index The index of the element to be removed.
941986
* @return The value that was associated with the index,
942987
* or null if there was no value.
988+
* @webref jsonarray:method
989+
* @brief Remove an index and close the hole
943990
*/
944991
public Object remove(int index) {
945992
Object o = this.opt(index);

0 commit comments

Comments
 (0)