Skip to content

Commit c0a77b6

Browse files
committed
Updates to Int/Float/StringDict for reference
1 parent b952cbd commit c0a77b6

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

core/src/processing/data/FloatDict.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public FloatDict(String[] keys, float[] values) {
7979

8080
/**
8181
* @webref floatdict:method
82-
* @brief To come...
82+
* @brief Returns the number of key/value pairs
8383
*/
8484
public int size() {
8585
return count;
@@ -122,7 +122,7 @@ protected void crop() {
122122

123123
/**
124124
* @webref floatdict:method
125-
* @brief To come...
125+
* @brief Return the internal array being used to store the keys
126126
*/
127127
public Iterable<String> keys() {
128128
return new Iterable<String>() {
@@ -210,7 +210,7 @@ public float value(int index) {
210210

211211
/**
212212
* @webref floatdict:method
213-
* @brief To come...
213+
* @brief Return the internal array being used to store the values
214214
*/
215215
public Iterable<Float> values() {
216216
return new Iterable<Float>() {
@@ -277,9 +277,9 @@ public float get(String key) {
277277

278278
/**
279279
* @webref floatdict:method
280-
* @brief To come...
280+
* @brief Create a new key/value pair or change the value of one
281281
*/
282-
public void set(String key, int amount) {
282+
public void set(String key, float amount) {
283283
int index = index(key);
284284
if (index == -1) {
285285
create(key, amount);
@@ -291,7 +291,7 @@ public void set(String key, int amount) {
291291

292292
/**
293293
* @webref floatdict:method
294-
* @brief To come...
294+
* @brief Check if a key is a part of the data structure
295295
*/
296296
public boolean hasKey(String key) {
297297
return index(key) != -1;
@@ -392,7 +392,7 @@ protected void create(String what, float much) {
392392

393393
/**
394394
* @webref floatdict:method
395-
* @brief To come...
395+
* @brief Remove a key/value pair
396396
*/
397397
public void remove(String key) {
398398
removeIndex(index(key));
@@ -463,7 +463,7 @@ public void sortKeys() {
463463

464464
/**
465465
* @webref floatdict:method
466-
* @brief To come...
466+
* @brief Sort the keys alphabetially in reverse
467467
*/
468468
public void sortKeysReverse() {
469469
sortImpl(true, true);
@@ -484,7 +484,7 @@ public void sortKeysReverse() {
484484
* Sort by values in descending order (largest value will be at [0]).
485485
*
486486
* @webref floatdict:method
487-
* @brief Sort by values in descending order
487+
* @brief Sort by values in ascending order
488488
*/
489489
public void sortValues() {
490490
sortImpl(false, false);
@@ -499,7 +499,7 @@ public void sortValues() {
499499

500500
/**
501501
* @webref floatdict:method
502-
* @brief To come...
502+
* @brief Sort by values in descending order
503503
*/
504504
public void sortValuesReverse() {
505505
sortImpl(false, true);

core/src/processing/data/IntDict.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public int value(int index) {
201201

202202
/**
203203
* @webref intdict:method
204-
* @brief To come...
204+
* @brief Return the internal array being used to store the keys
205205
*/
206206
public Iterable<Integer> values() {
207207
return new Iterable<Integer>() {

core/src/processing/data/StringDict.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public StringDict(String[] keys, String[] values) {
7777

7878
/**
7979
* @webref stringdict:method
80-
* @brief To come...
80+
* @brief Returns the number of key/value pairs
8181
*/
8282
public int size() {
8383
return count;
@@ -120,7 +120,7 @@ protected void crop() {
120120

121121
/**
122122
* @webref stringdict:method
123-
* @brief To come...
123+
* @brief Return the internal array being used to store the keys
124124
*/
125125
public Iterable<String> keys() {
126126
return new Iterable<String>() {
@@ -173,7 +173,7 @@ public String value(int index) {
173173

174174
/**
175175
* @webref stringdict:method
176-
* @brief To come...
176+
* @brief Return the internal array being used to store the values
177177
*/
178178
public Iterable<String> values() {
179179
return new Iterable<String>() {
@@ -206,7 +206,7 @@ public boolean hasNext() {
206206
* @webref stringdict:method
207207
* @brief Create a new array and copy each of the values into it
208208
*/
209-
public int[] valueArray() {
209+
public String[] valueArray() {
210210
return valueArray(null);
211211
}
212212

@@ -216,9 +216,9 @@ public int[] valueArray() {
216216
* creating a new array each time). If 'array' is null, or not the same
217217
* size as the number of values, a new array will be allocated and returned.
218218
*/
219-
public int[] valueArray(int[] array) {
219+
public String[] valueArray(String[] array) {
220220
if (array == null || array.length != size()) {
221-
array = new int[count];
221+
array = new String[count];
222222
}
223223
System.arraycopy(values, 0, array, 0, count);
224224
return array;
@@ -239,7 +239,7 @@ public String get(String key) {
239239

240240
/**
241241
* @webref stringdict:method
242-
* @brief To come...
242+
* @brief Create a new key/value pair or change the value of one
243243
*/
244244
public void set(String key, String amount) {
245245
int index = index(key);
@@ -258,7 +258,7 @@ public int index(String what) {
258258

259259
/**
260260
* @webref stringdict:method
261-
* @brief To come...
261+
* @brief Check if a key is a part of the data structure
262262
*/
263263
public boolean hasKey(String key) {
264264
return index(key) != -1;
@@ -278,7 +278,7 @@ protected void create(String key, String value) {
278278

279279
/**
280280
* @webref stringdict:method
281-
* @brief To come...
281+
* @brief Remove a key/value pair
282282
*/
283283
public void remove(String key) {
284284
removeIndex(index(key));
@@ -325,7 +325,7 @@ public void sortKeys() {
325325

326326
/**
327327
* @webref stringdict:method
328-
* @brief To come...
328+
* @brief Sort the keys alphabetially in reverse
329329
*/
330330
public void sortKeysReverse() {
331331
sortImpl(true, true);
@@ -336,7 +336,7 @@ public void sortKeysReverse() {
336336
* Sort by values in descending order (largest value will be at [0]).
337337
*
338338
* @webref stringdict:method
339-
* @brief Sort by values in descending order
339+
* @brief Sort by values in ascending order
340340
*/
341341
public void sortValues() {
342342
sortImpl(false, false);
@@ -345,7 +345,7 @@ public void sortValues() {
345345

346346
/**
347347
* @webref stringdict:method
348-
* @brief To come...
348+
* @brief Sort by values in descending order
349349
*/
350350
public void sortValuesReverse() {
351351
sortImpl(false, true);

0 commit comments

Comments
 (0)