Crossfire JXClient, Trunk
Static Public Member Functions | Private Member Functions | List of all members
com.realtime.crossfire.jxclient.util.NumberParser Class Reference
Collaboration diagram for com.realtime.crossfire.jxclient.util.NumberParser:
Collaboration graph

Static Public Member Functions

static boolean parseBoolean (@NotNull final String str) throws IOException
 
static< T extends Enum< T > T parseEnum (@NotNull final Class< T > class_, @NotNull final String name, @NotNull final String ident) throws IOException
 
static float parseFloat (@NotNull final String str) throws IOException
 
static int parseInt (@NotNull final String string, final int defaultValue)
 
static int parseInt (@NotNull final String string, final int defaultValue, final int minValue, final int maxValue)
 
static long parseLong (@NotNull final String string, final long defaultValue)
 

Private Member Functions

 NumberParser ()
 

Detailed Description

Utility class for parsing strings into numbers.

Author
Andreas Kirschbaum

Definition at line 32 of file NumberParser.java.

Constructor & Destructor Documentation

◆ NumberParser()

com.realtime.crossfire.jxclient.util.NumberParser.NumberParser ( )
private

Private constructor to prevent instantiation.

Definition at line 37 of file NumberParser.java.

Member Function Documentation

◆ parseBoolean()

static boolean com.realtime.crossfire.jxclient.util.NumberParser.parseBoolean ( @NotNull final String  str) throws IOException
static

◆ parseEnum()

static <T extends Enum<T> T com.realtime.crossfire.jxclient.util.NumberParser.parseEnum ( @NotNull final Class< T >  class_,
@NotNull final String  name,
@NotNull final String  ident 
) throws IOException
static

◆ parseFloat()

static float com.realtime.crossfire.jxclient.util.NumberParser.parseFloat ( @NotNull final String  str) throws IOException
static

Parses a float constant.

Parameters
strthe floating constant string to parse
Returns
the floating value
Exceptions
IOExceptionif a parsing error occurs

Definition at line 95 of file NumberParser.java.

Referenced by com.realtime.crossfire.jxclient.skin.io.ParseUtils.parseColorNull(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseDef(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseFill(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseFont(), and com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parsePicture().

Here is the caller graph for this function:

◆ parseInt() [1/2]

static int com.realtime.crossfire.jxclient.util.NumberParser.parseInt ( @NotNull final String  string,
final int  defaultValue 
)
static

Converts a string into an int value.

Parameters
stringthe string to convert
defaultValuethe value to return if the number is not a string
Returns
the int value

Definition at line 46 of file NumberParser.java.

Referenced by com.realtime.crossfire.jxclient.settings.Settings.getInt(), com.realtime.crossfire.jxclient.util.NumberParser.parseInt(), com.realtime.crossfire.jxclient.metaserver.MetaserverEntryParser.parseLine(), and com.realtime.crossfire.jxclient.window.JXCConnection.setHost().

Here is the caller graph for this function:

◆ parseInt() [2/2]

static int com.realtime.crossfire.jxclient.util.NumberParser.parseInt ( @NotNull final String  string,
final int  defaultValue,
final int  minValue,
final int  maxValue 
)
static

Converts a string into an int value in the given bounds.

Parameters
stringthe string to convert
defaultValuethe value to return if the number is not a string or not within bounds
minValuethe bound's minimum value
maxValuethe bound's maximum value
Returns
the int value

Definition at line 64 of file NumberParser.java.

References com.realtime.crossfire.jxclient.util.NumberParser.parseInt().

Here is the call graph for this function:

◆ parseLong()

static long com.realtime.crossfire.jxclient.util.NumberParser.parseLong ( @NotNull final String  string,
final long  defaultValue 
)
static

Converts a string into a long value.

Parameters
stringthe string to convert
defaultValuethe value to return if the number is not a string
Returns
the long value

Definition at line 80 of file NumberParser.java.

Referenced by com.realtime.crossfire.jxclient.settings.Settings.getLong(), and com.realtime.crossfire.jxclient.metaserver.MetaserverEntryParser.parseLine().

Here is the caller graph for this function:

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