求大神解释一下这段代码,新手感激不禁
processing吧
全部回复
仅看楼主
level 2
lijaro 楼主
Table(String filename) {
String[] rows = loadStrings(filename);
data = new String[rows.length][];
for (int i = 0; i < rows.length; i++) {
if (trim(rows[i]).length() == 0) {
continue; // skip empty rows
}
if (rows[i].startsWith("#")) {
continue; // skip comment lines
}
// split the row on the tabs
String[] pieces = split(rows[i], TAB);
// copy to the table array
data[rowCount] = pieces;
rowCount++;
// this could be done in one fell swoop via:
//data[rowCount++] = split(rows[i], TAB);
}
// resize the *data* array as necessary
data = (String[][]) subset(data, 0, rowCount);
}
2014年10月09日 14点10分 1
1