Crossfire JXClient, Trunk
R20561
|
Utility class for parsing strings into numbers. More...
Static Public Member Functions | |
static boolean | parseBoolean (@NotNull final String str) throws IOException |
Parses a boolean constant. More... | |
static< T extends Enum< T > T | parseEnum (@NotNull final Class< T > class_, @NotNull final String name, @NotNull final String ident) throws IOException |
Parses an enum constant. More... | |
static float | parseFloat (@NotNull final String str) throws IOException |
Parses a float constant. More... | |
static int | parseInt (@NotNull final String string, final int defaultValue) |
Converts a string into an int value. More... | |
static int | parseInt (@NotNull final String string, final int defaultValue, final int minValue, final int maxValue) |
Converts a string into an int value in the given bounds. More... | |
static long | parseLong (@NotNull final String string, final long defaultValue) |
Converts a string into a long value. More... | |
Private Member Functions | |
NumberParser () | |
Private constructor to prevent instantiation. More... | |
Utility class for parsing strings into numbers.
Definition at line 31 of file NumberParser.java.
|
private |
Private constructor to prevent instantiation.
Definition at line 36 of file NumberParser.java.
|
static |
Parses a boolean constant.
str | the boolean constant string to parse |
IOException | if a parsing error occurs |
Definition at line 108 of file NumberParser.java.
Referenced by com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseButton(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseCommandText(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseDialog(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseQueryText(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseScrollbar(), com.realtime.crossfire.jxclient.skin.io.CommandParser.parseSelect(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseText(), and com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseTextButton().
|
static |
Parses an enum constant.
<T> | the enum class |
class_ | the enum class the enum constant belongs to |
name | the enum constant to parse |
ident | the description of the enum class for building error messages |
IOException | if the enum constant does not exist |
Definition at line 127 of file NumberParser.java.
Referenced by com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseCommandList(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseDialogHide(), com.realtime.crossfire.jxclient.skin.io.CommandParser.parseExecSelection(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLabelSpell(), com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLabelStat(), and com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseLabelStat2().
|
static |
Parses a float constant.
str | the floating constant string to parse |
IOException | if a parsing error occurs |
Definition at line 94 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().
|
static |
Converts a string into an int value.
string | the string to convert |
defaultValue | the value to return if the number is not a string |
Definition at line 45 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().
|
static |
Converts a string into an int value in the given bounds.
string | the string to convert |
defaultValue | the value to return if the number is not a string or not within bounds |
minValue | the bound's minimum value |
maxValue | the bound's maximum value |
Definition at line 63 of file NumberParser.java.
References com.realtime.crossfire.jxclient.util.NumberParser.parseInt().
|
static |
Converts a string into a long value.
string | the string to convert |
defaultValue | the value to return if the number is not a string |
Definition at line 79 of file NumberParser.java.
Referenced by com.realtime.crossfire.jxclient.settings.Settings.getLong(), and com.realtime.crossfire.jxclient.metaserver.MetaserverEntryParser.parseLine().