- public boolean parse_line(String line) {
- String[] items = line.split("\\s+");
- if (line.startsWith("MMA655X value:")) {
- if (items.length >= 3)
- accel = Integer.parseInt(items[1]);
- } else
- return false;
- return true;
+ public boolean parse_line(String line) throws NumberFormatException {
+ if (line.startsWith("MMA655X value")) {
+ String[] items = line.split("\\s+");
+ if (items.length >= 3) {
+ accel = Integer.parseInt(items[2]);
+ return true;
+ }
+ }
+ return false;