Class JSONNumber

java.lang.Object
com.google.gwt.json.client.JSONValue
com.google.gwt.json.client.JSONNumber

public class JSONNumber extends JSONValue
Represents a JSON number. Numbers are represented by doubles.
  • Constructor Details

    • JSONNumber

      public JSONNumber(double value)
      Creates a new JSONNumber from the double value.
  • Method Details

    • doubleValue

      public double doubleValue()
      Gets the double value this JSONNumber represents.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • getValue

      @Deprecated public double getValue()
      Deprecated.
      Gets the double value this JSONNumber represents.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isNumber

      public JSONNumber isNumber()
      Returns this, as this is a JSONNumber.
      Overrides:
      isNumber in class JSONValue
      Returns:
      a reference to a JSONNumber if this JSONValue is a JSONNumber or null otherwise.
    • toString

      public String toString()
      Returns the JSON representation of this number.
      Specified by:
      toString in class JSONValue
    • getUnwrapper

      JavaScriptObject getUnwrapper()
      Description copied from class: JSONValue
      Internal. Returns a JS func that can unwrap this value. Used from native code.
      Specified by:
      getUnwrapper in class JSONValue