()
| 37 | } |
| 38 | |
| 39 | public int countTokens() { |
| 40 | int count = 0; |
| 41 | boolean sawNonDelimiter = false; |
| 42 | for (int i = position; i < in.length(); ++i) { |
| 43 | if (isDelimiter(in.charAt(i))) { |
| 44 | if (sawNonDelimiter) { |
| 45 | sawNonDelimiter = false; |
| 46 | ++ count; |
| 47 | } |
| 48 | |
| 49 | if (includeDelimiters) { |
| 50 | ++ count; |
| 51 | } |
| 52 | } else { |
| 53 | sawNonDelimiter = true; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | if (sawNonDelimiter) { |
| 58 | ++ count; |
| 59 | } |
| 60 | |
| 61 | return count; |
| 62 | } |
| 63 | |
| 64 | public boolean hasMoreTokens() { |
| 65 | for (int i = position; i < in.length(); ++i) { |
no test coverage detected