check on indices settings for the other Dict classes

This commit is contained in:
Ben Fry
2014-04-11 13:35:34 -04:00
parent 01fb49f172
commit 16e972f674
3 changed files with 2 additions and 7 deletions
+1 -3
View File
@@ -53,18 +53,16 @@ public class FloatDict {
* @nowebref
*/
public FloatDict(BufferedReader reader) {
// public FloatHash(PApplet parent, String filename) {
String[] lines = PApplet.loadStrings(reader);
keys = new String[lines.length];
values = new float[lines.length];
// boolean csv = (lines[0].indexOf('\t') == -1);
for (int i = 0; i < lines.length; i++) {
// String[] pieces = csv ? Table.splitLineCSV(lines[i]) : PApplet.split(lines[i], '\t');
String[] pieces = PApplet.split(lines[i], '\t');
if (pieces.length == 2) {
keys[count] = pieces[0];
values[count] = PApplet.parseFloat(pieces[1]);
indices.put(pieces[0], count);
count++;
}
}
-3
View File
@@ -76,14 +76,11 @@ public class IntDict {
* @nowebref
*/
public IntDict(BufferedReader reader) {
// public IntHash(PApplet parent, String filename) {
String[] lines = PApplet.loadStrings(reader);
keys = new String[lines.length];
values = new int[lines.length];
// boolean csv = (lines[0].indexOf('\t') == -1);
for (int i = 0; i < lines.length; i++) {
// String[] pieces = csv ? Table.splitLineCSV(lines[i]) : PApplet.split(lines[i], '\t');
String[] pieces = PApplet.split(lines[i], '\t');
if (pieces.length == 2) {
keys[count] = pieces[0];
+1 -1
View File
@@ -1,6 +1,6 @@
0225 core
X bug with StringDict(Reader) that wasn't setting the indices hashmap
_ check this with other versions of this class
X check this with other versions of this class
X call revalidate() via reflection
X text looks lousy compared to the Apple JVM
X mess with rendering hints? (notes in PGraphicsJava2D)