Skip to content

Commit 5221faa

Browse files
committed
minor edits pulled in from ftsv project
1 parent 9b725a2 commit 5221faa

1 file changed

Lines changed: 30 additions & 8 deletions

File tree

core/src/processing/data/Table.java

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ protected void parseAwfulCSV(BufferedReader reader,
548548
*/
549549

550550

551-
class CommaSeparatedLine {
551+
static class CommaSeparatedLine {
552552
char[] c;
553553
String[] pieces;
554554
int pieceCount;
@@ -797,6 +797,23 @@ static protected String[] splitLineCSV(String line, BufferedReader reader) throw
797797
i++;
798798
ii++;
799799
}
800+
/*
801+
if (autoTyping) {
802+
if (autoTypes == null) {
803+
autoTypes = new int[pieces.length];
804+
805+
} else {
806+
if (autoTypes.length < pieces.length) {
807+
808+
}
809+
Double.parseDouble("");
810+
Float.parseFloat("blah");
811+
// if (autoTypes[pieceCount]) {
812+
//
813+
// }
814+
}
815+
}
816+
*/
800817
String s = new String(c, start, ii - start);
801818
pieces[pieceCount++] = s;
802819
}
@@ -2000,12 +2017,7 @@ public void setColumnType(String columnName, String columnType) {
20002017
}
20012018

20022019

2003-
/**
2004-
* Set the data type for a column so that using it is more efficient.
2005-
* @param column the column to change
2006-
* @param columnType One of int, long, float, double, string, or category.
2007-
*/
2008-
public void setColumnType(int column, String columnType) {
2020+
static int parseColumnType(String columnType) {
20092021
columnType = columnType.toLowerCase();
20102022
int type = -1;
20112023
if (columnType.equals("string")) {
@@ -2023,7 +2035,17 @@ public void setColumnType(int column, String columnType) {
20232035
} else {
20242036
throw new IllegalArgumentException("'" + columnType + "' is not a valid column type.");
20252037
}
2026-
setColumnType(column, type);
2038+
return type;
2039+
}
2040+
2041+
2042+
/**
2043+
* Set the data type for a column so that using it is more efficient.
2044+
* @param column the column to change
2045+
* @param columnType One of int, long, float, double, string, or category.
2046+
*/
2047+
public void setColumnType(int column, String columnType) {
2048+
setColumnType(column, parseColumnType(columnType));
20272049
}
20282050

20292051

0 commit comments

Comments
 (0)