From 1600657e02229e07b667b8b0dbb2a2e859f9606e Mon Sep 17 00:00:00 2001 From: REAS Date: Sun, 26 May 2013 23:41:55 -0700 Subject: [PATCH] Updates to Int/Float/StringDict for reference --- core/src/processing/data/FloatDict.java | 20 ++++++++++---------- core/src/processing/data/IntDict.java | 2 +- core/src/processing/data/StringDict.java | 24 ++++++++++++------------ 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/core/src/processing/data/FloatDict.java b/core/src/processing/data/FloatDict.java index 102493802..777ebc52c 100644 --- a/core/src/processing/data/FloatDict.java +++ b/core/src/processing/data/FloatDict.java @@ -79,7 +79,7 @@ public class FloatDict { /** * @webref floatdict:method - * @brief To come... + * @brief Returns the number of key/value pairs */ public int size() { return count; @@ -122,7 +122,7 @@ public class FloatDict { /** * @webref floatdict:method - * @brief To come... + * @brief Return the internal array being used to store the keys */ public Iterable keys() { return new Iterable() { @@ -210,7 +210,7 @@ public class FloatDict { /** * @webref floatdict:method - * @brief To come... + * @brief Return the internal array being used to store the values */ public Iterable values() { return new Iterable() { @@ -277,9 +277,9 @@ public class FloatDict { /** * @webref floatdict:method - * @brief To come... + * @brief Create a new key/value pair or change the value of one */ - public void set(String key, int amount) { + public void set(String key, float amount) { int index = index(key); if (index == -1) { create(key, amount); @@ -291,7 +291,7 @@ public class FloatDict { /** * @webref floatdict:method - * @brief To come... + * @brief Check if a key is a part of the data structure */ public boolean hasKey(String key) { return index(key) != -1; @@ -392,7 +392,7 @@ public class FloatDict { /** * @webref floatdict:method - * @brief To come... + * @brief Remove a key/value pair */ public void remove(String key) { removeIndex(index(key)); @@ -463,7 +463,7 @@ public class FloatDict { /** * @webref floatdict:method - * @brief To come... + * @brief Sort the keys alphabetially in reverse */ public void sortKeysReverse() { sortImpl(true, true); @@ -484,7 +484,7 @@ public class FloatDict { * Sort by values in descending order (largest value will be at [0]). * * @webref floatdict:method - * @brief Sort by values in descending order + * @brief Sort by values in ascending order */ public void sortValues() { sortImpl(false, false); @@ -499,7 +499,7 @@ public class FloatDict { /** * @webref floatdict:method - * @brief To come... + * @brief Sort by values in descending order */ public void sortValuesReverse() { sortImpl(false, true); diff --git a/core/src/processing/data/IntDict.java b/core/src/processing/data/IntDict.java index 22e52c600..ae6e06dcd 100644 --- a/core/src/processing/data/IntDict.java +++ b/core/src/processing/data/IntDict.java @@ -201,7 +201,7 @@ public class IntDict { /** * @webref intdict:method - * @brief To come... + * @brief Return the internal array being used to store the keys */ public Iterable values() { return new Iterable() { diff --git a/core/src/processing/data/StringDict.java b/core/src/processing/data/StringDict.java index 7a32db9fe..ad8342b6e 100644 --- a/core/src/processing/data/StringDict.java +++ b/core/src/processing/data/StringDict.java @@ -77,7 +77,7 @@ public class StringDict { /** * @webref stringdict:method - * @brief To come... + * @brief Returns the number of key/value pairs */ public int size() { return count; @@ -120,7 +120,7 @@ public class StringDict { /** * @webref stringdict:method - * @brief To come... + * @brief Return the internal array being used to store the keys */ public Iterable keys() { return new Iterable() { @@ -173,7 +173,7 @@ public class StringDict { /** * @webref stringdict:method - * @brief To come... + * @brief Return the internal array being used to store the values */ public Iterable values() { return new Iterable() { @@ -206,7 +206,7 @@ public class StringDict { * @webref stringdict:method * @brief Create a new array and copy each of the values into it */ - public int[] valueArray() { + public String[] valueArray() { return valueArray(null); } @@ -216,9 +216,9 @@ public class StringDict { * 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. */ - public int[] valueArray(int[] array) { + public String[] valueArray(String[] array) { if (array == null || array.length != size()) { - array = new int[count]; + array = new String[count]; } System.arraycopy(values, 0, array, 0, count); return array; @@ -239,7 +239,7 @@ public class StringDict { /** * @webref stringdict:method - * @brief To come... + * @brief Create a new key/value pair or change the value of one */ public void set(String key, String amount) { int index = index(key); @@ -258,7 +258,7 @@ public class StringDict { /** * @webref stringdict:method - * @brief To come... + * @brief Check if a key is a part of the data structure */ public boolean hasKey(String key) { return index(key) != -1; @@ -278,7 +278,7 @@ public class StringDict { /** * @webref stringdict:method - * @brief To come... + * @brief Remove a key/value pair */ public void remove(String key) { removeIndex(index(key)); @@ -325,7 +325,7 @@ public class StringDict { /** * @webref stringdict:method - * @brief To come... + * @brief Sort the keys alphabetially in reverse */ public void sortKeysReverse() { sortImpl(true, true); @@ -336,7 +336,7 @@ public class StringDict { * Sort by values in descending order (largest value will be at [0]). * * @webref stringdict:method - * @brief Sort by values in descending order + * @brief Sort by values in ascending order */ public void sortValues() { sortImpl(false, false); @@ -345,7 +345,7 @@ public class StringDict { /** * @webref stringdict:method - * @brief To come... + * @brief Sort by values in descending order */ public void sortValuesReverse() { sortImpl(false, true);