/**
* @param line
* @return
*/
static List parseLine(String line) {
List row = new ArrayList();
StringTokenizer rowToken = new StringTokenizer(line,","); //$NON-NLS-1$
for(int i=0; rowToken.hasMoreTokens(); i++){
String data = rowToken.nextToken();
if(data.charAt(0) == '"') {
data = data.substring(1, data.length()-1);
}
if(data.equals("N/A")) { //$NON-NLS-1$
row.add(null);
} else if(i==1 || i==4 || i== 5 || i==6 || i==7) {
row.add(Double.valueOf(data));
} else if(i==8) {
row.add(new BigInteger(data));
} else if(i==2) {
if(!data.equals("0")){ //$NON-NLS-1$
try {
Date date = DATE_FORMAT.parse(data);
row.add(new java.sql.Date(date.getTime()));
} catch(ParseException e) {
Object[] params = new Object[] { data, e.getMessage() };
LogManager.logWarning(LogConstants.CTX_CONNECTOR, YahooPlugin.Util.getString("YahooExecution.Parse_date_error", params)); //$NON-NLS-1$
row.add(null);
}
} else{
row.add(null);
}
} else if(i==3) {
if(!data.equals("0")){ //$NON-NLS-1$
try {
Date time = TIME_FORMAT.parse(data);
row.add(new java.sql.Time(time.getTime()));
} catch(ParseException e) {
Object[] params = new Object[] { data, e.getMessage() };
LogManager.logWarning(LogConstants.CTX_CONNECTOR, YahooPlugin.Util.getString("YahooExecution.Parse_time_value", params)); //$NON-NLS-1$
row.add(null);
}
} else {
row.add(null);
}
} else {
row.add(data);
}
}
return row;
}