public TableParser(String format) throws IOException, NumberFormatException { int start = 0; StringTokenizer stoker = new StringTokenizer(format, " ,"); while (stoker.hasMoreTokens()) { String tok = stoker.nextToken(); // see what type Class type = String.class; char last = tok.charAt(tok.length() - 1); if (last == 'i') type = int.class; if (last == 'd') type = double.class; if (last == 'L') type = long.class; if (type != String.class) tok = tok.substring(0, tok.length() - 1); int end = Integer.parseInt(tok); fields.add(new Field(start, end, type)); start = end; } }
public TableParser(String format) throws IOException, NumberFormatException { int start = 0; StringTokenizer stoker = new StringTokenizer(format, " ,"); while (stoker.hasMoreTokens()) { String tok = stoker.nextToken(); // see what type Class type = String.class; char last = tok.charAt(tok.length() - 1); if (last == 'i') type = int.class; if (last == 'd') type = double.class; if (last == 'L') type = long.class; if (type != String.class) tok = tok.substring(0, tok.length() - 1); int end = Integer.parseInt(tok); fields.add(new Field(start, end, type)); start = end; } }
public TableParser(String format) throws IOException, NumberFormatException { int start = 0; StringTokenizer stoker = new StringTokenizer(format, " ,"); while (stoker.hasMoreTokens()) { String tok = stoker.nextToken(); // see what type Class type = String.class; char last = tok.charAt(tok.length() - 1); if (last == 'i') type = int.class; if (last == 'd') type = double.class; if (last == 'L') type = long.class; if (type != String.class) tok = tok.substring(0, tok.length() - 1); int end = Integer.parseInt(tok); fields.add(new Field(start, end, type)); start = end; } }