ESAT
 All Classes Namespaces Files Functions Variables Enumerator Pages
Public Member Functions | Static Public Member Functions | List of all members
broad.core.parser.StringParser Class Reference

Public Member Functions

 StringParser ()
 
void parse (String s)
 
void clear ()
 
void parse (String s, String regexp)
 
int getIndexFor (String string)
 
int getFieldCount ()
 
String asString (int index)
 
int asInt (int index)
 
long asLong (int index)
 
double asDouble (int index)
 
float asFloat (int index)
 
String[] getStringArray ()
 

Static Public Member Functions

static String firstField (String s)
 
static String[] getTokens (String s)
 

Detailed Description

Author
prussell Parse a string around whitespace or another specified delimiter Get full array of parsed strings or individual values by index, parsed to various types

Constructor & Destructor Documentation

broad.core.parser.StringParser.StringParser ( )

Here is the caller graph for this function:

Member Function Documentation

double broad.core.parser.StringParser.asDouble ( int  index)

Gets the token at specified position and parses to a double

Parameters
indexThe position
Returns
the desired token as a double
float broad.core.parser.StringParser.asFloat ( int  index)

Gets the token at specified position and parses to a float

Parameters
indexThe position
Returns
the desired token as a float
int broad.core.parser.StringParser.asInt ( int  index)

Gets the token at specified position and parses to an int

Parameters
indexThe position
Returns
the desired token as an int
long broad.core.parser.StringParser.asLong ( int  index)

Gets the token at specified position and parses to a long

Parameters
indexThe position
Returns
the desired token as an int
String broad.core.parser.StringParser.asString ( int  index)

Gets the token at specified position

Parameters
indexThe position
Returns
the desired token as a String

Here is the caller graph for this function:

void broad.core.parser.StringParser.clear ( )
static String broad.core.parser.StringParser.firstField ( String  s)
static

Get the first field of a whitespace-delimited string

Parameters
sThe string
Returns
The first field

Here is the call graph for this function:

int broad.core.parser.StringParser.getFieldCount ( )

Get number of fields

Returns
number of fields

Here is the caller graph for this function:

int broad.core.parser.StringParser.getIndexFor ( String  string)

Get position of the string in array

Parameters
stringThe string
Returns
The first position equal to the string
String [] broad.core.parser.StringParser.getStringArray ( )

Gets the array of tokens

Returns
all the parsed tokens as a String[]
static String [] broad.core.parser.StringParser.getTokens ( String  s)
static

Parses the string around whitespace and stores tokens

Parameters
sThe string to parse
Returns
Tokens
void broad.core.parser.StringParser.parse ( String  s)

Parses the string around whitespace and stores tokens

Parameters
sThe string to parse
void broad.core.parser.StringParser.parse ( String  s,
String  regexp 
)

Parses the string around the specified delimiter and stores tokens

Parameters
sThe string to parse
regexpRegular expression for delimiter (for period use "\\.")

The documentation for this class was generated from the following file: