From c611de43ae830e0649ef2f8b3ef98b49ce9eafe6 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Mon, 17 Apr 2017 13:23:46 -0400 Subject: [PATCH] thinking about adding getTally() to IntDict --- core/src/processing/data/IntList.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/src/processing/data/IntList.java b/core/src/processing/data/IntList.java index fda738c54..627187d06 100644 --- a/core/src/processing/data/IntList.java +++ b/core/src/processing/data/IntList.java @@ -852,6 +852,19 @@ public class IntList implements Iterable { } +// /** +// * Count the number of times each entry is found in this list. +// * Converts each entry to a String so it can be used as a key. +// */ +// public IntDict getTally() { +// IntDict outgoing = new IntDict(); +// for (int i = 0; i < count; i++) { +// outgoing.increment(String.valueOf(data[i])); +// } +// return outgoing; +// } + + public IntList getSubset(int start) { return getSubset(start, count - start); }