|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.stanford.nlp.math.NumberMatchingRegex
public class NumberMatchingRegex
This file includes a regular expression to match numbers. This will save quite a bit of time in places where you want to test if something is a number without wasting the time to parse it or throw an exception if it isn't. For example, you can call isDouble() to see if a String is a double without having to try/catch the NumberFormatException that gets produced if it is not. The regular expression is conveniently provided in the javadoc for Double. http://java.sun.com/javase/6/docs/api/java/lang/Double.html
| Method Summary | |
|---|---|
static boolean |
isDecimalInteger(java.lang.String string)
Tests to see if an integer is a decimal integer, perhaps starting with +/-. |
static boolean |
isDouble(java.lang.String string)
Returns true if the number can be successfully parsed by Double. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean isDecimalInteger(java.lang.String string)
public static boolean isDouble(java.lang.String string)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||