public class JsGlobals extends Object
Modifier and Type | Method and Description |
---|---|
static String |
decodeURI(String encodedURI)
Decodes an encoded URI to a URI string.
|
static String |
decodeURIComponent(String encodedURIComponent)
Decodes an encoded URI component to a URI component string.
|
static String |
encodeURI(String uri)
Encodes a URI string by escaping all characters not allowed in URIs.
|
static String |
encodeURIComponent(String uriComponent)
Encodes a URI component string by escaping all characters not allowed in
URIs.
|
static boolean |
isFinite(double value)
Indicates if
value is a finite number. |
static boolean |
isNaN(double value)
Indicates if
value is NaN . |
static double |
parseFloat(String value)
Produces a
double value by interpreting the contents of
value as a decimal literal. |
static double |
parseFloat(String value,
int radix)
Produces a
double value by interpreting the contents of
value as a decimal literal. |
static double |
parseInt(String value)
Produces a integral value by interpreting the contents of
value as a integer literal. |
static double |
parseInt(String value,
int radix)
Produces a integral value by interpreting the contents of
value as a integer literal. |
public static String decodeURIComponent(String encodedURIComponent)
public static String encodeURI(String uri)
public static String encodeURIComponent(String uriComponent)
public static boolean isFinite(double value)
value
is a finite number.public static boolean isNaN(double value)
value
is NaN
.public static double parseFloat(String value)
double
value by interpreting the contents of
value
as a decimal literal.public static double parseFloat(String value, int radix)
double
value by interpreting the contents of
value
as a decimal literal.public static double parseInt(String value)
value
as a integer literal. The value returned by this method
will be an integral value or NaN
, so the return value is a
double
.
Example use: // Will yield zero if s is not a valid integer. int value = (int)parseInt(s); // To check if the value is valid. double value = parseInt(s); if (isNaN(value)) //Invalid value.
public static double parseInt(String value, int radix)
value
as a integer literal. The value returned by this method
will be an integral value or NaN
, so the return value is a
double
.
Example use: // Will yield zero if s is not a valid integer. int value = (int)parseInt(s); // To check if the value is valid. double value = parseInt(s); if (isNaN(value)) //Invalid value.
Copyright © 2016. All rights reserved.