code: public static boolean isDigitsOnly(CharSequence str) {
          final int len = str.length();
          for (int i = 0; i < len; i++) {
              if (!Character.isDigit(str.charAt(i))) {
                  return false;
              }
          }
          return true;
      }
docs: Returns whether the given CharSequence contains only digits.