String str = tok.nextToken().trim();
int idx = str.indexOf('#');
if( idx!=-1) {
int enumType = Integer.parseInt(str.substring(0,idx));
int enumVal = Integer.parseInt(str.substring(idx+1));
node.getData()[0] = new ExpressionValue(enumType,enumVal);
}
// is it boolean?
else if( str.length()==1 && "tf".indexOf(Character.toLowerCase(str.charAt(0)))!=-1 ) {
node.getData()[i] = new ExpressionValue(str.equalsIgnoreCase("t"));
}
// is it a string?
else if( str.charAt(0)=='\"' ) {
node.getData()[i] = new ExpressionValue(str.substring(1,str.length()-1));
}
// is it an integer
else if( str.indexOf('.')==-1 && str.toLowerCase().indexOf('e')==-1) {
long l;
try {
l = Long.parseLong(str);
} catch(NumberFormatException ex) {
// sometimes Java will output a long value that is larger than can be parsed
// this is very likely not a useful genome and we just set it to zero so that
// the population load does not fail.
l=0;
}
node.getData()[i] = new ExpressionValue(l);
}
// At this point, must be a float
else {
node.getData()[i] = new ExpressionValue(CSVFormat.EG_FORMAT.parse(str));
}
}
}
return this.nodeStack.pop();