Class StringNumberUtilities

java.lang.Object
org.gvsig.utils.stringNumberUtilities.StringNumberUtilities

public class StringNumberUtilities extends Object
This class has methods for verify if an string is a number, and which kind of number.
Author:
Pablo Piqueras Bartolomé (p_queras@hotmail.com)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Returns true if the word is an integer number; else returns false If it's a natural number, it's an integer number
    static boolean
    Returns true if the word is a natural number; else returns false
    static boolean
    Returns true if the word is a number; else returns false
    static boolean
    Returns true if the word is a real number; else returns false It's supposed that '.' is the symbol for separate integer from decimal part If it's a natural or integer, it's a real number
    static boolean
    Returns true if the word is a real number with or without the 'E' (or 'e') symbol for the exponent; else returns false
    It's supposed that '.' is the symbol for separate integer from decimal part in the base.
    static boolean
    Returns true if the word is a real number with or without the 'E' (or 'e') symbol for the exponent; else returns false It's supposed that '.' is the symbol for separate integer from decimal part, in the base and the exponent of the number If it's a natural, integer, real number or real number with integer exponent, it's a real number with real exponent

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StringNumberUtilities

      public StringNumberUtilities()
  • Method Details

    • isNumber

      public static boolean isNumber(String word)
      Returns true if the word is a number; else returns false
      Parameters:
      word - An string
      Returns:
      A boolean value
    • isNaturalNumber

      public static boolean isNaturalNumber(String word)
      Returns true if the word is a natural number; else returns false
      Parameters:
      word - An string
      Returns:
      A boolean value
    • isIntegerNumber

      public static boolean isIntegerNumber(String word)
      Returns true if the word is an integer number; else returns false If it's a natural number, it's an integer number
      Parameters:
      word - An string
      Returns:
      A boolean value
    • isRealNumber

      public static boolean isRealNumber(String word)
      Returns true if the word is a real number; else returns false It's supposed that '.' is the symbol for separate integer from decimal part If it's a natural or integer, it's a real number
      Parameters:
      word - An string
      Returns:
      A boolean value
    • isRealNumberWithIntegerExponent

      public static boolean isRealNumberWithIntegerExponent(String word)
      Returns true if the word is a real number with or without the 'E' (or 'e') symbol for the exponent; else returns false
      It's supposed that '.' is the symbol for separate integer from decimal part in the base.
      The exponent must be an integer number If it's a natural, integer or real number, it's a real number with integer exponent
      Parameters:
      word - An string
      Returns:
      A boolean value
    • isRealNumberWithRealExponent

      public static boolean isRealNumberWithRealExponent(String word)
      Returns true if the word is a real number with or without the 'E' (or 'e') symbol for the exponent; else returns false It's supposed that '.' is the symbol for separate integer from decimal part, in the base and the exponent of the number If it's a natural, integer, real number or real number with integer exponent, it's a real number with real exponent
      Parameters:
      word - An string
      Returns:
      A boolean value