code: public static boolean isNumber(String pString) {
          if (isEmpty(pString)) {
              return false;
          }
  
          // Special case for first char, may be minus sign ('-')
          char ch = pString.charAt(0);
          if (!(ch == '-' || Character.isDigit(ch))) {
              return false;
          }
  
          // Test every char
          for (int i = 1; i < pString.length(); i++) {
              if (!Character.isDigit(pString.charAt(i))) {
                  return false;
              }
          }
  
          // All digits must be a natural number
          return true;
      }
docs: Tests a string, to see if it is an number (element of <b>Z</b>).
  Valid integers are positive natural numbers (1, 2, 3, ...),
  their negatives (?1, ?2, ?3, ...) and the number zero.
  <p/>
  Note that there is no guarantees made, that this number can be
  represented as either an int or a long.
  
  @param pString The string to check.
  @return true if the String is a natural number.