data
Class NumberParser

java.lang.Object
  extended by data.NumberParser

public class NumberParser
extends java.lang.Object

Class that provides a static method to parse a string and return a double.
No constructor is needed because the class is only used in static context.


Field Summary
(package private) static boolean printLog
          Flag to enable debug message printing for this class.
 
Constructor Summary
NumberParser()
           
 
Method Summary
private static void log(java.lang.String message)
          Prints debug information to stdout when printLog is set to true.
static double parseNumber(java.lang.String string)
          Addresses issues with the standard parsing method of NumberFormat by verifying the parse position after parsing to ensure that all the input was parsed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

printLog

static final boolean printLog
Flag to enable debug message printing for this class.

See Also:
Constant Field Values
Constructor Detail

NumberParser

public NumberParser()
Method Detail

parseNumber

public static double parseNumber(java.lang.String string)
                          throws java.text.ParseException
Addresses issues with the standard parsing method of NumberFormat by verifying the parse position after parsing to ensure that all the input was parsed.

Parameters:
string - the string to be parsed
Returns:
the double value
Throws:
java.text.ParseException - the parse exception

log

private static void log(java.lang.String message)
Prints debug information to stdout when printLog is set to true.

Parameters:
message - the message