(Scanner scanner)
| 62 | public InvalidPlyFormatException(String message) { |
| 63 | super(message); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | |
| 68 | enum Type { |
| 69 | CHAR { |
| 70 | @Override |
| 71 | public Number parse(Scanner scanner) throws IOException { |
| 72 | try { |
| 73 | int value=scanner.nextInt(); |
| 74 | if (value<-Byte.MIN_VALUE || value>Byte.MAX_VALUE) throw new InputMismatchException("Char out of range"); |
| 75 | return value; |
| 76 | } catch (InputMismatchException e) { |
| 77 | throw new InvalidPlyFormatException("Cannot parse '"+scanner.next()+"' as char", e); |
| 78 | } catch (NoSuchElementException e) { |
nothing calls this directly
no test coverage detected