Breaks the specified string into an array of ints. Returns null if there is an error.
(String s)
| 607 | /** Breaks the specified string into an array |
| 608 | of ints. Returns null if there is an error.*/ |
| 609 | public int[] s2ints(String s) { |
| 610 | StringTokenizer st = new StringTokenizer(s, ", \t"); |
| 611 | int nInts = st.countTokens(); |
| 612 | if (nInts==0) return null; |
| 613 | int[] ints = new int[nInts]; |
| 614 | for(int i=0; i<nInts; i++) { |
| 615 | try {ints[i] = Integer.parseInt(st.nextToken());} |
| 616 | catch (NumberFormatException e) {return null;} |
| 617 | } |
| 618 | return ints; |
| 619 | } |
| 620 | |
| 621 | //boolean isRunning(){return running;} |
| 622 |
no test coverage detected