Skip to content

Commit d4066e2

Browse files
committed
Reference additions for Lists and Dicts
1 parent 5eb7fe1 commit d4066e2

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

core/src/processing/data/FloatList.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99

1010
/**
11+
* Helper class for a list of floats. Lists are designed to have some of the
12+
* features of ArrayLists, but to maintain the simplicity and efficiency of
13+
* working with arrays.
14+
*
15+
* Functions like sort() and shuffle() always act on the list itself. To get
16+
* a sorted copy, use list.copy().sort().
17+
*
1118
* @webref data:composite
1219
*/
1320
public class FloatList implements Iterable<Float> {
@@ -665,7 +672,7 @@ public boolean hasNext() {
665672
* @webref floatlist:method
666673
* @brief Create a new array with a copy of all the values
667674
*/
668-
public int[] array() {
675+
public float[] array() {
669676
return array(null);
670677
}
671678

@@ -674,9 +681,9 @@ public int[] array() {
674681
* Copy as many values as possible into the specified array.
675682
* @param array
676683
*/
677-
public int[] array(int[] array) {
684+
public float[] array(float[] array) {
678685
if (array == null || array.length != count) {
679-
array = new int[count];
686+
array = new float[count];
680687
}
681688
System.arraycopy(data, 0, array, 0, count);
682689
return array;

core/src/processing/data/IntList.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313

1414

1515
/**
16-
* Helper class for a list of ints. By design (for efficiency), functions like
17-
* sort() and shuffle() always act on the list itself. To get a sorted copy,
18-
* use list.copy().sort().
16+
* Helper class for a list of ints. Lists are designed to have some of the
17+
* features of ArrayLists, but to maintain the simplicity and efficiency of
18+
* working with arrays.
19+
*
20+
* Functions like sort() and shuffle() always act on the list itself. To get
21+
* a sorted copy, use list.copy().sort().
1922
*
2023
* @webref data:composite
2124
*/
@@ -338,7 +341,7 @@ public int index(int what) {
338341

339342
/**
340343
* @webref floatlist:method
341-
* @brief Check if a number is a part of the data structure
344+
* @brief Check if a number is a part of the list
342345
*/
343346
public boolean hasValue(int value) {
344347
// if (indexCache == null) {

core/src/processing/data/StringList.java

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

99
/**
10+
* Helper class for a list of Strings. Lists are designed to have some of the
11+
* features of ArrayLists, but to maintain the simplicity and efficiency of
12+
* working with arrays.
13+
*
14+
* Functions like sort() and shuffle() always act on the list itself. To get
15+
* a sorted copy, use list.copy().sort().
16+
*
1017
* @webref data:composite
1118
*/
1219
public class StringList implements Iterable<String> {

0 commit comments

Comments
 (0)