From 4ac2e7c4dc4f14abe7247e4f72e9c782f9043cc8 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Thu, 30 May 2013 16:20:38 -0400 Subject: [PATCH] remove() not working for intList, floatList, StringList (#1826) --- core/src/processing/data/FloatList.java | 32 +++++++-------- core/src/processing/data/IntList.java | 38 ++++++++--------- core/src/processing/data/StringList.java | 52 ++++++++++++------------ core/todo.txt | 2 + 4 files changed, 63 insertions(+), 61 deletions(-) diff --git a/core/src/processing/data/FloatList.java b/core/src/processing/data/FloatList.java index 31479e4cc..19aa9dc87 100644 --- a/core/src/processing/data/FloatList.java +++ b/core/src/processing/data/FloatList.java @@ -8,13 +8,13 @@ import processing.core.PApplet; /** - * Helper class for a list of floats. Lists are designed to have some of the + * Helper class for a list of floats. Lists are designed to have some of the * features of ArrayLists, but to maintain the simplicity and efficiency of - * working with arrays. - * - * Functions like sort() and shuffle() always act on the list itself. To get + * working with arrays. + * + * Functions like sort() and shuffle() always act on the list itself. To get * a sorted copy, use list.copy().sort(). - * + * * @webref data:composite */ public class FloatList implements Iterable { @@ -62,7 +62,7 @@ public class FloatList implements Iterable { /** * Get the length of the list. - * + * * @webref floatlist:method * @brief Get the length of the list */ @@ -127,8 +127,8 @@ public class FloatList implements Iterable { /** - * Remove an element from the specified index. - * + * Remove an element from the specified index. + * * @webref floatlist:method * @brief Remove an element from the specified index */ @@ -138,7 +138,7 @@ public class FloatList implements Iterable { // count--; // System.arraycopy(data, index + 1, outgoing, 0, count - index); // data = outgoing; - for (int i = index; i < count; i++) { + for (int i = index; i < count-1; i++) { data[i] = data[i+1]; } count--; @@ -232,8 +232,8 @@ public class FloatList implements Iterable { - /** - * Add a new entry to the list. + /** + * Add a new entry to the list. * * @webref floatlist:method * @brief Add a new entry to the list @@ -516,8 +516,8 @@ public class FloatList implements Iterable { } - /** - * Sorts the array in place. + /** + * Sorts the array in place. * * @webref floatlist:method * @brief Sorts an array, lowest to highest @@ -527,8 +527,8 @@ public class FloatList implements Iterable { } - /** - * Reverse sort, orders values from highest to lowest + /** + * Reverse sort, orders values from highest to lowest * * @webref floatlist:method * @brief Reverse sort, orders values from highest to lowest @@ -572,7 +572,7 @@ public class FloatList implements Iterable { count = num; } - /** + /** * @webref floatlist:method * @brief Reverse sort, orders values by first digit */ diff --git a/core/src/processing/data/IntList.java b/core/src/processing/data/IntList.java index 58780421a..80ba7840c 100644 --- a/core/src/processing/data/IntList.java +++ b/core/src/processing/data/IntList.java @@ -13,13 +13,13 @@ import processing.core.PApplet; /** - * Helper class for a list of ints. Lists are designed to have some of the + * Helper class for a list of ints. Lists are designed to have some of the * features of ArrayLists, but to maintain the simplicity and efficiency of - * working with arrays. - * - * Functions like sort() and shuffle() always act on the list itself. To get + * working with arrays. + * + * Functions like sort() and shuffle() always act on the list itself. To get * a sorted copy, use list.copy().sort(). - * + * * @webref data:composite */ public class IntList implements Iterable { @@ -67,7 +67,7 @@ public class IntList implements Iterable { /** * Get the length of the list. - * + * * @webref floatlist:method * @brief Get the length of the list */ @@ -91,7 +91,7 @@ public class IntList implements Iterable { /** * Remove all entries from the list. - * + * * @webref floatlist:method * @brief Remove all entries from the list */ @@ -131,8 +131,8 @@ public class IntList implements Iterable { } - /** - * Remove an element from the specified index + /** + * Remove an element from the specified index * * @webref floatlist:method * @brief Remove an element from the specified index @@ -143,7 +143,7 @@ public class IntList implements Iterable { // count--; // System.arraycopy(data, index + 1, outgoing, 0, count - index); // data = outgoing; - for (int i = index; i < count; i++) { + for (int i = index; i < count-1; i++) { data[i] = data[i+1]; } count--; @@ -175,11 +175,11 @@ public class IntList implements Iterable { } - /** + /** * Add a new entry to the list. * * @webref floatlist:method - * @brief Add a new entry to the list + * @brief Add a new entry to the list */ public void append(int value) { if (count == data.length) { @@ -427,9 +427,9 @@ public class IntList implements Iterable { } - /** - * Sorts the array in place. - * + /** + * Sorts the array in place. + * * @webref floatlist:method * @brief Sorts the array, lowest to highest */ @@ -438,8 +438,8 @@ public class IntList implements Iterable { } - /** - * Reverse sort, orders values from highest to lowest. + /** + * Reverse sort, orders values from highest to lowest. * * @webref floatlist:method * @brief Reverse sort, orders values from highest to lowest @@ -483,7 +483,7 @@ public class IntList implements Iterable { // count = num; // } - /** + /** * @webref floatlist:method * @brief Reverse sort, orders values by first digit */ @@ -575,7 +575,7 @@ public class IntList implements Iterable { /** * Create a new array with a copy of all the values. - * + * * @return an array sized by the length of the list with each of the values. * @webref floatlist:method * @brief Create a new array with a copy of all the values diff --git a/core/src/processing/data/StringList.java b/core/src/processing/data/StringList.java index abc1cae8d..e242a2e52 100644 --- a/core/src/processing/data/StringList.java +++ b/core/src/processing/data/StringList.java @@ -7,13 +7,13 @@ import java.util.Random; import processing.core.PApplet; /** - * Helper class for a list of Strings. Lists are designed to have some of the + * Helper class for a list of Strings. Lists are designed to have some of the * features of ArrayLists, but to maintain the simplicity and efficiency of - * working with arrays. - * - * Functions like sort() and shuffle() always act on the list itself. To get + * working with arrays. + * + * Functions like sort() and shuffle() always act on the list itself. To get * a sorted copy, use list.copy().sort(). - * + * * @webref data:composite */ public class StringList implements Iterable { @@ -127,9 +127,9 @@ public class StringList implements Iterable { } - /** - * Remove an element from the specified index. - * + /** + * Remove an element from the specified index. + * * @webref stringlist:method * @brief Remove an element from the specified index */ @@ -139,7 +139,7 @@ public class StringList implements Iterable { // count--; // System.arraycopy(data, index + 1, outgoing, 0, count - index); // data = outgoing; - for (int i = index; i < count; i++) { + for (int i = index; i < count-1; i++) { data[i] = data[i+1]; } count--; @@ -229,9 +229,9 @@ public class StringList implements Iterable { } - /** - * Add a new entry to the list. - * + /** + * Add a new entry to the list. + * * @webref stringlist:method * @brief Add a new entry to the list */ @@ -414,9 +414,9 @@ public class StringList implements Iterable { } - /** - * Sorts the array in place. - * + /** + * Sorts the array in place. + * * @webref stringlist:method * @brief Sorts the array in place */ @@ -425,11 +425,11 @@ public class StringList implements Iterable { } - /** + /** * Reverse sort, orders values from highest to lowest. - * + * * @webref stringlist:method - * @brief Reverse sort, orders values from highest to lowest + * @brief Reverse sort, orders values from highest to lowest */ public void sortReverse() { sortImpl(true); @@ -478,7 +478,7 @@ public class StringList implements Iterable { /** * @webref stringlist:method - * @brief To come... + * @brief To come... */ public void reverse() { int ii = count - 1; @@ -494,7 +494,7 @@ public class StringList implements Iterable { /** * Randomize the order of the list elements. Note that this does not * obey the randomSeed() function in PApplet. - * + * * @webref stringlist:method * @brief Randomize the order of the list elements */ @@ -527,9 +527,9 @@ public class StringList implements Iterable { } - /** - * Make the entire list lower case. - * + /** + * Make the entire list lower case. + * * @webref stringlist:method * @brief Make the entire list lower case */ @@ -542,8 +542,8 @@ public class StringList implements Iterable { } - /** - * Make the entire list upper case. + /** + * Make the entire list upper case. * * @webref stringlist:method * @brief Make the entire list upper case @@ -602,7 +602,7 @@ public class StringList implements Iterable { /** * Create a new array with a copy of all the values. - * + * * @return an array sized by the length of the list with each of the values. * @webref stringlist:method * @brief Create a new array with a copy of all the values diff --git a/core/todo.txt b/core/todo.txt index e12dc8a31..d68ecc607 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -7,6 +7,8 @@ X patch to make font textures smaller in P2D/P3D X https://github.com/processing/processing/pull/1775 X .png data written when .jpg file specified with save/saveFrame() X https://github.com/processing/processing/issues/1810 +X remove() not working for intList, floatList, StringList +X https://github.com/processing/processing/issues/1826 andres A PImage not drawn after resize()/get() in P2D/P3D