Class StringNumberUtilities
java.lang.Object
org.gvsig.utils.stringNumberUtilities.StringNumberUtilities
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisIntegerNumber(String word) Returns true if the word is an integer number; else returns false If it's a natural number, it's an integer numberstatic booleanisNaturalNumber(String word) Returns true if the word is a natural number; else returns falsestatic booleanReturns true if the word is a number; else returns falsestatic booleanisRealNumber(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 numberstatic booleanReturns 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 booleanReturns 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
-
Constructor Details
-
StringNumberUtilities
public StringNumberUtilities()
-
-
Method Details
-
isNumber
Returns true if the word is a number; else returns false- Parameters:
word- An string- Returns:
- A boolean value
-
isNaturalNumber
Returns true if the word is a natural number; else returns false- Parameters:
word- An string- Returns:
- A boolean value
-
isIntegerNumber
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
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
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
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
-