elemental.json.impl.
Class JreJsonNumber
- java.lang.Object
-
- elemental.json.impl.JreJsonValue
-
- elemental.json.impl.JreJsonNumber
-
All Implemented Interfaces:
public class JreJsonNumber extends JreJsonValue implements JsonNumber
Server-side implementation of JsonNumber.
See Also:
-
-
Constructor Summary
Constructors Constructor Description JreJsonNumber(double number)
-
Method Summary
All Methods Modifier and Type Method Description boolean
asBoolean()
Coerces underlying value to boolean according to the rules of Javascript coercion.
double
asNumber()
Coerces the underlying value to a number according to the rules of Javascript coercion.
String
asString()
Coerces the underlying value to a String according to the rules of JavaScript coercion.
double
getNumber()
Object
getObject()
JsonType
getType()
Returns an enumeration representing the fundamental JSON type.
boolean
jsEquals(JsonValue value)
Equivalent of Javascript '==' operator comparison between two values.
String
toJson()
Returns a serialized JSON string representing this value.
void
traverse(elemental.json.impl.JsonVisitor visitor, elemental.json.impl.JsonContext ctx)
-
Methods inherited from class elemental.json.impl.JreJsonValue
parseJson, toNative
-
-
-
-
Method Detail
-
asBoolean
public boolean asBoolean()
Description copied from interface:
JsonValue
Coerces underlying value to boolean according to the rules of Javascript coercion.
-
asNumber
public double asNumber()
Description copied from interface:
JsonValue
Coerces the underlying value to a number according to the rules of Javascript coercion.
-
asString
public String asString()
Description copied from interface:
JsonValue
Coerces the underlying value to a String according to the rules of JavaScript coercion.
-
getNumber
public double getNumber()
Specified by:
getNumber
in interfaceJsonNumber
-
getObject
public Object getObject()
Specified by:
getObject
in classJreJsonValue
-
getType
public JsonType getType()
Description copied from interface:
JsonValue
Returns an enumeration representing the fundamental JSON type.
-
jsEquals
public boolean jsEquals(JsonValue value)
Description copied from interface:
JsonValue
Equivalent of Javascript '==' operator comparison between two values.
-
traverse
public void traverse(elemental.json.impl.JsonVisitor visitor, elemental.json.impl.JsonContext ctx)
Specified by:
traverse
in classJreJsonValue
-
-