Class JSONNumber


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

      • JSONNumber

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

      • doubleValue

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

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • getValue

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

        public int hashCode()
        Overrides:
        hashCode in class java.lang.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 java.lang.String toString()
        Returns the JSON representation of this number.
        Specified by:
        toString in class JSONValue