public int countTokens(String line, int ich) {
    int tokenCount = 0;
    if (line != null) {
      int ichMax = line.length();
      char ch;
      while (true) {
        while (ich < ichMax && ((ch = line.charAt(ich)) == ' ' || ch == '\t'))
          ++ich;
        if (ich == ichMax)
          break;
        ++tokenCount;
        do {
          ++ich;
        } while (ich < ichMax && ((ch = line.charAt(ich)) != ' ' && ch != '\t'));
      }
    }
    return tokenCount;
  }