| Package | ch.capi.utils |
| Class | public class ParseUtils |
| Inheritance | ParseUtils Object |
String parsing.
| Method | Defined By | ||
|---|---|---|---|
isBoolean(str:String):Boolean [static]
Retrieves if the specified String is a valid Boolean. | ParseUtils | ||
isColor(str:String):Boolean [static]
Retrieves if the specified String is a color. | ParseUtils | ||
isFloat(str:String):Boolean [static]
Retrieves if the specified String is a valid Number. | ParseUtils | ||
isInteger(str:String):Boolean [static]
Retrieves if the specified String is a valid Integer. | ParseUtils | ||
isUnsigned(str:String):Boolean [static]
Retrieves if the specified String is a valid unsigned Integer. | ParseUtils | ||
parseBoolean(str:String):Boolean [static]
Parses the specified String to a Boolean. | ParseUtils | ||
parseColor(str:String):uint [static]
Parses the specified String into a color. | ParseUtils | ||
parseFloat(str:String):Number [static]
Parses the specified String to a Float using the parseFloat global function. | ParseUtils | ||
parseInteger(str:String, radix:int = 0):int [static]
Parses the specified String to a Integer using the parseInt global function. | ParseUtils | ||
parseNumber(str:String):Number [static]
Parses the specified String to a Number using the Number global function. | ParseUtils | ||
parseUnsigned(str:String):uint [static]
Parses the specified String to an unsigned Integer. | ParseUtils | ||
| isBoolean | () | method |
public static function isBoolean(str:String):Boolean
Retrieves if the specified String is a valid Boolean.
A valid boolean can be the following values :
truefalseInteger valueParameters
str:String — The String to check.
|
Boolean — true if the String is a valid Boolean.
|
| isColor | () | method |
public static function isColor(str:String):Boolean
Retrieves if the specified String is a color. A color is defined
by its RGB value, beginning with a '0x' or a '#' (0xFFFAAA or #FFFAAA).
Parameters
str:String — The String to test.
|
Boolean — true if the String can be parsed as color.
|
| isFloat | () | method |
public static function isFloat(str:String):Boolean
Retrieves if the specified String is a valid Number.
A valid Number can be one of the following :
Float valueParameters
str:String — The String to check.
|
Boolean — true if the String is a valid Number.
|
| isInteger | () | method |
public static function isInteger(str:String):Boolean
Retrieves if the specified String is a valid Integer. A valid Integer
can end with a dot (10.).
Parameters
str:String — The String to check.
|
Boolean — true if the String is a valid Integer.
|
| isUnsigned | () | method |
public static function isUnsigned(str:String):Boolean
Retrieves if the specified String is a valid unsigned Integer. A valid unsigned
Integer can end with a dot (10.).
Parameters
str:String — The String to check.
|
Boolean — true if the String is a valid unsigned Integer.
|
| parseBoolean | () | method |
public static function parseBoolean(str:String):Boolean
Parses the specified String to a Boolean.
Here are the allowed values :
truefalseInteger value (only the value 0 will return false)Parameters
str:String — The String to parse.
|
Boolean — A uint.
|
ch.capi.errors:ParseError If — the specified String is not a valid Boolean.
|
See also
| parseColor | () | method |
public static function parseColor(str:String):uint
Parses the specified String into a color.
Parameters
str:String — The String to parse.
|
uint — A uint representing the color.
|
ch.capi.errors:ParseError If — the specified String is not a valid color.
|
See also
| parseFloat | () | method |
public static function parseFloat(str:String):Number
Parses the specified String to a Float using the parseFloat global function.
Parameters
str:String — The String to parse.
|
Number — A Number.
|
ch.capi.errors:ParseError If — the specified String is not a valid Number.
|
See also
| parseInteger | () | method |
public static function parseInteger(str:String, radix:int = 0):int
Parses the specified String to a Integer using the parseInt global function.
Parameters
str:String — The String to parse.
| |
radix:int (default = 0) — The base for the attribute parsing.
|
int — A int.
|
ch.capi.errors:ParseError If — the specified String is not a valid Integer.
|
See also
| parseNumber | () | method |
public static function parseNumber(str:String):Number
Parses the specified String to a Number using the Number global function. This
method doesn't perform any verification and just use the global Number parse function.
Parameters
str:String — The String to parse.
|
Number — A Number.
|
| parseUnsigned | () | method |
public static function parseUnsigned(str:String):uint
Parses the specified String to an unsigned Integer.
Parameters
str:String — The String to parse.
|
uint — A uint.
|
ch.capi.errors:ParseError If — the specified String is not a valid unsigned Integer.
|
See also