Back up one character. This provides a sort of lookahead capability, so that you can test for a digit or letter before attempting to parse the next number or identifier.
()
| 98 | * next number or identifier. |
| 99 | */ |
| 100 | public void back() throws JSONException { |
| 101 | if (this.usePrevious || this.index <= 0) { |
| 102 | throw new JSONException("Stepping back two steps is not supported"); |
| 103 | } |
| 104 | this.index -= 1; |
| 105 | this.character -= 1; |
| 106 | this.usePrevious = true; |
| 107 | this.eof = false; |
| 108 | } |
| 109 | |
| 110 | public boolean end() { |
| 111 | return this.eof && !this.usePrevious; |