code: public boolean hasNextInt(int radix) {
          setRadix(radix);
          boolean result = hasNext(integerPattern());
          if (result) { // Cache it
              try {
                  String s = (matcher.group(SIMPLE_GROUP_INDEX) == null) ?
                      processIntegerToken(hasNextResult) :
                      hasNextResult;
                  typeCache = Integer.parseInt(s, radix);
              } catch (NumberFormatException nfe) {
                  result = false;
              }
          }
          return result;
      }
docs: Returns true if the next token in this scanner's input can be
  interpreted as an int value in the specified radix using the
  {@link #nextInt} method. The scanner does not advance past any input.
  
  @param radix the radix used to interpret the token as an int value
  @return true if and only if this scanner's next token is a valid
  int value
  @throws IllegalStateException if this scanner is closed