Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

com::cosylab::gui::components::r2::FloatingPointParser Class Reference

List of all members.

Public Member Functions

 FloatingPointParser ()
synchronized final double parseDouble (String s) throws RuntimeException

Private Member Functions

final void doAction (int state, int symbol, char ch)
final int getNextSymbol (char ch)
final boolean parse (String s)

Private Attributes

String a = ""
String b = ""
String c = ""

Static Private Attributes

final int ERROR_STATE = 99
final int[][] transitions
final java.text.DecimalFormatSymbols symbols = new java.text.DecimalFormatSymbols()

Detailed Description

Simple, robust floating point number parser.

The parser is derived from the following regular expression:

[+-]?[0-9]*(\.[0-9]*)?((e[+-]?)[0-9]*)?

This expression allows maximum flexibility in description of floating point numbers, while still generating expected output. Every state of this parser is final and therefore suitable for parsing of sequential user input, where intermediate states are not valid values.

Creation date: (12/16/2001 16:46:23)

Author:
: Ales Pucelj (ales.pucelj@kgb.ijs.si)


Constructor & Destructor Documentation

com::cosylab::gui::components::r2::FloatingPointParser::FloatingPointParser  )  [inline]
 

Creates new parser.


Member Function Documentation

final void com::cosylab::gui::components::r2::FloatingPointParser::doAction int  state,
int  symbol,
char  ch
[inline, private]
 

Performs action associated with each state. Creation date: (12/16/2001 17:04:50)

Parameters:
state int
ch Char

final int com::cosylab::gui::components::r2::FloatingPointParser::getNextSymbol char  ch  )  [inline, private]
 

Returns symbol based on character. Creation date: (12/16/2001 16:49:11)

Returns:
int
Parameters:
ch char

final boolean com::cosylab::gui::components::r2::FloatingPointParser::parse String  s  )  [inline, private]
 

Performs the actual parsing. Creation date: (12/16/2001 16:48:37)

Returns:
boolean
Parameters:
s java.lang.String

synchronized final double com::cosylab::gui::components::r2::FloatingPointParser::parseDouble String  s  )  throws RuntimeException [inline]
 

Parses the supplied string and tries to convert it to double. Creation date: (12/16/2001 16:47:57)

Exceptions:
RuntimeException 
Returns:
double
Parameters:
s java.lang.String


Member Data Documentation

String com::cosylab::gui::components::r2::FloatingPointParser::a = "" [private]
 

String com::cosylab::gui::components::r2::FloatingPointParser::b = "" [private]
 

String com::cosylab::gui::components::r2::FloatingPointParser::c = "" [private]
 

final int com::cosylab::gui::components::r2::FloatingPointParser::ERROR_STATE = 99 [static, private]
 

final java.text.DecimalFormatSymbols com::cosylab::gui::components::r2::FloatingPointParser::symbols = new java.text.DecimalFormatSymbols() [static, private]
 

final int [][] com::cosylab::gui::components::r2::FloatingPointParser::transitions [static, private]
 

Initial value:

{ { 99, 1, 1, 2, 3 }, { 99, 99, 1, 2, 3 }, { 99, 99, 2, 99, 3 }, { 99, 4, 4, 99, 99 }, { 99, 99, 4, 99, 99 } }


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 03:12:27 2009 for ACS Java API by doxygen 1.3.8