sealed abstract class JsonNumber extends AnyRef

JSON numbers with optimization by cases. Note: Javascript numbers are 64-bit decimals.

Source
JsonNumber.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JsonNumber
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def toBigDecimal: BigDecimal

    Returns this number as a BigDecimal.

  2. abstract def toLong: Option[Long]

    Returns this number as a Long, only if this number is a valid Long.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def asJson: Json
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(that: Any): Boolean
    Definition Classes
    JsonNumber → AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    JsonNumber → AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. def toBigInt: Option[BigInt]

    Returns this number as a BigInt, only if this number is an integer.

  18. def toByte: Option[Byte]

    Returns this number as a Byte, only if this number is a valid Byte.

  19. lazy val toDouble: Option[Double]

    Returns this number as a Double, only if this number can be represented as a Double.

  20. lazy val toFloat: Option[Float]

    Returns this number as a Float, only if this number can be represented as a Float.

  21. def toInt: Option[Int]

    Returns this number as a Int, only if this number is a valid Int.

  22. def toShort: Option[Short]

    Returns this number as a Short, only if this number is a valid Short.

  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. def truncateToBigInt: Option[BigInt]

    Truncates the number to a BigInt.

    Truncates the number to a BigInt. Truncation means that we round the real number towards 0 to the closest BigInt.

    Truncation fails for numbers whose decimal representation contains more than 2 ^ 18 digits, since creating BigInt values for these numbers is computationally expensive.

  25. def truncateToByte: Byte

    Truncates the number to a Byte.

    Truncates the number to a Byte. Truncation means that we round the real number towards 0 to the closest, valid Byte. So, if the number is 1e99, then this will return Byte.MaxValue.

  26. def truncateToDouble: Double

    Truncates this number to the best Double approximation to this number.

    Truncates this number to the best Double approximation to this number. Anything over Double.MaxValue gets rounded to Double.PositiveInfinity and anything below Double.MinValue gets rounded to Double.NegativeInfinity.

  27. def truncateToFloat: Float

    Truncates this number to the best Float approximation to this number.

    Truncates this number to the best Float approximation to this number. Anything over Float.MaxValue gets rounded to Float.PositiveInfinity and anything below Float.MinValue gets rounded to Float.NegativeInfinity.

  28. def truncateToInt: Int

    Truncates the number to a Int.

    Truncates the number to a Int. Truncation means that we round the real number towards 0 to the closest, valid Int. So, if the number is 1e99, then this will return Int.MaxValue.

  29. def truncateToLong: Long

    Truncates the number to a Long.

    Truncates the number to a Long. Truncation means that we round the real number towards 0 to the closest, valid Long. So, if the number is 1e99, then this will return Long.MaxValue.

  30. def truncateToShort: Short

    Truncates the number to a Short.

    Truncates the number to a Short. Truncation means that we round the real number towards 0 to the closest, valid Short. So, if the number is 1e99, then this will return Short.MaxValue.

  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped