code: private static int isNumeric(String s) {
          final char[] chars = s.toCharArray();
          int num = 0;
  
          // note: this method does not account for leading zeroes as could occur in build
          // meta data parts. Leading zeroes are thus simply ignored when parsing the
          // number.
          for (int i = 0; i < chars.length; ++i) {
              final char c = chars[i];
              if (c >= '0' && c <= '9') {
                  num = num * DECIMAL + Character.digit(c, DECIMAL);
              } else {
                  return -1;
              }
          }
          return num;
      }
docs: Determines whether s is a positive number. If it is, the number is returned,
  otherwise the result is -1.
  
  @param s The String to check.
  @return The positive number (incl. 0) if s a number, or -1 if it is not.