Revision: e080bbab02e2
Author: Tony@kibeth
Date: Mon May 30 10:51:08 2011
Log: Replaced all the StringTokenizer Objects (which are deprecated
and les...
http://code.google.com/p/ifcsoft/source/detail?r=e080bbab02e2
Revision: 721165392c86
Author: Tony@kibeth
Date: Mon May 30 10:58:22 2011
Log: Replaced all the StringTokenizer Objects (which are deprecated
and les...
http://code.google.com/p/ifcsoft/source/detail?r=721165392c86
Revision: 0495a0c26837
Author: Caveman@Saraneth
Date: Mon May 30 14:22:09 2011
Log: Remove some old code for specific data sets and some comments.
http://code.google.com/p/ifcsoft/source/detail?r=0495a0c26837
==============================================================================
Revision: e080bbab02e2
Author: Tony@kibeth
Date: Mon May 30 10:51:08 2011
Log: Replaced all the StringTokenizer Objects (which are deprecated
and less efficient) with String arrays using String.split().
http://code.google.com/p/ifcsoft/source/detail?r=e080bbab02e2
Modified:
/src/ifcSoft/model/dataSet/RawData.java
=======================================
--- /src/ifcSoft/model/dataSet/RawData.java Mon May 23 15:32:41 2011
+++ /src/ifcSoft/model/dataSet/RawData.java Mon May 30 10:51:08 2011
@@ -358,20 +358,20 @@
length = 0;
int dataRows = 0;
+ String st[];
while(line != null){
- StringTokenizer st = new StringTokenizer(line, ",");
-
+ //StringTokenizer st = new StringTokenizer(line, ",");
+ st = line.split(",");
//if the column labels aren't set, then this is the first read
if(columnLabels == null){
- columnLabels = new String[st.countTokens()];
+ //columnLabels = new String[st.countTokens()];
+ columnLabels = st;
for(int i = 0; i < columnLabels.length; i++){
- columnLabels[i] = st.nextToken();
- if(columnLabels[i].contentEquals("F0") ||
- columnLabels[i].contentEquals("\"F0\"")){
- columnLabels[i] = "SSC-A";
- }
- if(columnLabels[i].contentEquals("F1") ||
- columnLabels[i].contentEquals("\"F1\"") ){
+ //columnLabels[i] = st.nextToken();
+ if(columnLabels[i].contentEquals("F0") ||
columnLabels[i].contentEquals("\"F0\"")){
+ columnLabels[i] = "SSC-A";
+ }
+ if(columnLabels[i].contentEquals("F1") ||
columnLabels[i].contentEquals("\"F1\"") ){
columnLabels[i] = "FSC-A";
}
}
@@ -389,9 +389,11 @@
boolean didLoadRow = true;
String name = null;
if(hasNames){
- name = st.nextToken();
- }
- if(st.countTokens() != columnLabels.length){
+ //name = st.nextToken();
+ name = st[0];
+ }
+ //if(st.countTokens() != columnLabels.length){
+ if(st.length != columnLabels.length){
System.out.println("Error reading FCS, columns in row"
+dataRows+" didn't match");
didLoadRow = false;
@@ -399,7 +401,8 @@
try{
for(int i = 0; i < columnLabels.length; i++){
- thisrow[i] = Float.parseFloat(st.nextToken());
+ //thisrow[i] = Float.parseFloat(st.nextToken());
+ thisrow[i] = Float.parseFloat(st[i]);
}
}catch(Exception e){
didLoadRow = false;
@@ -538,19 +541,4 @@
return (String[]) newLabels.toArray(new String[0]);
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
+}
==============================================================================
Revision: 721165392c86
Author: Tony@kibeth
Date: Mon May 30 10:58:22 2011
Log: Replaced all the StringTokenizer Objects (which are deprecated
and less efficient) with String arrays using String.split().
http://code.google.com/p/ifcsoft/source/detail?r=721165392c86
Modified:
/src/ifcSoft/model/dataSet/RawData.java
=======================================
--- /src/ifcSoft/model/dataSet/RawData.java Mon May 30 10:51:08 2011
+++ /src/ifcSoft/model/dataSet/RawData.java Mon May 30 10:58:22 2011
@@ -26,12 +26,12 @@
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.HttpURLConnection;
+//import java.io.Reader;
+//import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.LinkedList;
-import java.util.StringTokenizer;
+//import java.util.StringTokenizer;
/**
*
==============================================================================
Revision: 0495a0c26837
Author: Caveman@Saraneth
Date: Mon May 30 14:22:09 2011
Log: Remove some old code for specific data sets and some comments.
http://code.google.com/p/ifcsoft/source/detail?r=0495a0c26837
Modified:
/src/ifcSoft/model/dataSet/RawData.java
=======================================
--- /src/ifcSoft/model/dataSet/RawData.java Mon May 30 10:58:22 2011
+++ /src/ifcSoft/model/dataSet/RawData.java Mon May 30 14:22:09 2011
@@ -26,12 +26,9 @@
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
-//import java.io.Reader;
-//import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.LinkedList;
-//import java.util.StringTokenizer;
/**
*
@@ -360,21 +357,10 @@
int dataRows = 0;
String st[];
while(line != null){
- //StringTokenizer st = new StringTokenizer(line, ",");
st = line.split(",");
//if the column labels aren't set, then this is the first read
if(columnLabels == null){
- //columnLabels = new String[st.countTokens()];
columnLabels = st;
- for(int i = 0; i < columnLabels.length; i++){
- //columnLabels[i] = st.nextToken();
- if(columnLabels[i].contentEquals("F0") ||
columnLabels[i].contentEquals("\"F0\"")){
- columnLabels[i] = "SSC-A";
- }
- if(columnLabels[i].contentEquals("F1") ||
columnLabels[i].contentEquals("\"F1\"") ){
- columnLabels[i] = "FSC-A";
- }
- }
if(columnLabels[0].equalsIgnoreCase("name") ||
columnLabels[0].equalsIgnoreCase("file")){
hasNames = true;
String temp[] = new String[columnLabels.length-1];
@@ -387,12 +373,10 @@
}else{//the column labels have been read
float[] thisrow = new float[columnLabels.length];
boolean didLoadRow = true;
- String name = null;
+ String pointName = null;
if(hasNames){
- //name = st.nextToken();
- name = st[0];
- }
- //if(st.countTokens() != columnLabels.length){
+ pointName = st[0];
+ }
if(st.length != columnLabels.length){
System.out.println("Error reading FCS, columns in row"
+dataRows+" didn't match");
@@ -401,7 +385,6 @@
try{
for(int i = 0; i < columnLabels.length; i++){
- //thisrow[i] = Float.parseFloat(st.nextToken());
thisrow[i] = Float.parseFloat(st[i]);
}
}catch(Exception e){
@@ -413,7 +396,7 @@
if(didLoadRow){
tempData.add(thisrow);
if(hasNames){
- tempNames.add(name);
+ tempNames.add(pointName);
}
dataRows++;
loadProgress++;