Gridarta Editor
net.sf.gridarta.utils.NumberUtils Class Reference

Utility class for parsing strings into numbers. More...

+ Collaboration diagram for net.sf.gridarta.utils.NumberUtils:

Static Public Member Functions

static double parseDouble (@NotNull final String s)
 Parses a double string. More...
 
static int parseInt (@NotNull final String s)
 Parses an integer string. More...
 
static int parseInt (@NotNull final String s, final int defaultValue)
 Parses an integer string. More...
 
static long parseLong (@NotNull final String s)
 Parses a long string. More...
 

Private Member Functions

 NumberUtils ()
 Private constructor to prevent instantiation. More...
 

Detailed Description

Utility class for parsing strings into numbers.

Author
Andreas Kirschbaum

Definition at line 28 of file NumberUtils.java.

Constructor & Destructor Documentation

◆ NumberUtils()

net.sf.gridarta.utils.NumberUtils.NumberUtils ( )
private

Private constructor to prevent instantiation.

Definition at line 33 of file NumberUtils.java.

Member Function Documentation

◆ parseDouble()

static double net.sf.gridarta.utils.NumberUtils.parseDouble ( @NotNull final String  s)
static

Parses a double string.

Parameters
sthe string to parse
Returns
the double value or zero if value not readable

Definition at line 85 of file NumberUtils.java.

Referenced by net.sf.gridarta.model.baseobject.AbstractBaseObject< G, A, R, G >.getAttributeDouble(), and net.sf.gridarta.var.crossfire.model.io.MapArchObjectParser.parseLine().

+ Here is the caller graph for this function:

◆ parseInt() [1/2]

◆ parseInt() [2/2]

static int net.sf.gridarta.utils.NumberUtils.parseInt ( @NotNull final String  s,
final int  defaultValue 
)
static

Parses an integer string.

Parameters
sthe string to parse
defaultValuethe default value
Returns
the integer value or the default value if value not readable

Definition at line 51 of file NumberUtils.java.

◆ parseLong()

static long net.sf.gridarta.utils.NumberUtils.parseLong ( @NotNull final String  s)
static

Parses a long string.

Parameters
sthe string to parse
Returns
the long value or zero if value not readable

Definition at line 68 of file NumberUtils.java.

Referenced by net.sf.gridarta.model.baseobject.AbstractBaseObject< G, A, R, G >.getAttributeLong().

+ Here is the caller graph for this function:

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