src/main/java/de/uapcore/sudoku/DocumentHandler.java

changeset 12
1c62c6009161
parent 11
f7433671fec5
child 22
06170a0be62a
equal deleted inserted replaced
11:f7433671fec5 12:1c62c6009161
57 if (line.matches("^\\s*$")) { 57 if (line.matches("^\\s*$")) {
58 continue; 58 continue;
59 } 59 }
60 Matcher m = pat.matcher(line); 60 Matcher m = pat.matcher(line);
61 if (m.matches()) { 61 if (m.matches()) {
62 String c[] = line.trim().split(" "); 62 String[] c = line.trim().split(" ");
63 if (c.length != 9) { 63 if (c.length != 9) {
64 break; 64 break;
65 } 65 }
66 for (int i = 0 ; i < 9 ; i++) { 66 for (int i = 0 ; i < 9 ; i++) {
67 field.setCellValue(i, row, 67 field.setCellValue(i, row,
68 c[i].equals("_") ? 0 : Integer.valueOf(c[i])); 68 c[i].equals("_") ? 0 : Integer.parseInt(c[i]));
69 } 69 }
70 row++; 70 row++;
71 } else { 71 } else {
72 break; 72 break;
73 } 73 }

mercurial