scala

Long

class Long extends Any with AnyVal

Long is a member of the value classes, those whose instances are not represented as objects by the underlying host system.

There is an implicit conversion from Long => RichLong which provides useful non-primitive operations.

Attributes
final
Source
Long.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Long
  2. AnyVal
  3. Any
Visibility
  1. Public
  2. All

Value Members

  1. def != (x: Double): Boolean

  2. def != (x: Float): Boolean

  3. def != (x: Long): Boolean

  4. def != (x: Int): Boolean

  5. def != (x: Char): Boolean

  6. def != (x: Short): Boolean

  7. def != (x: Byte): Boolean

  8. def != (arg0: Any): Boolean

    Test two objects for inequality.

    Test two objects for inequality.

    returns

    true if !(this == that), false otherwise.

    Attributes
    final
    Definition Classes
    Any
  9. def ## (): Int

    Equivalent to x.hashCode except for boxed numeric types.

    Equivalent to x.hashCode except for boxed numeric types. For numerics, it returns a hash value which is consistent with value equality: if two value type instances compare as true, then ## will produce the same hash value for each of them.

    returns

    a hash value consistent with ==

    Attributes
    final
    Definition Classes
    Any
  10. def % (x: Double): Double

  11. def % (x: Float): Float

  12. def % (x: Long): Long

  13. def % (x: Int): Long

  14. def % (x: Char): Long

  15. def % (x: Short): Long

  16. def % (x: Byte): Long

  17. def & (x: Long): Long

  18. def & (x: Int): Long

  19. def & (x: Char): Long

  20. def & (x: Short): Long

  21. def & (x: Byte): Long

  22. def * (x: Double): Double

  23. def * (x: Float): Float

  24. def * (x: Long): Long

  25. def * (x: Int): Long

  26. def * (x: Char): Long

  27. def * (x: Short): Long

  28. def * (x: Byte): Long

  29. def + (x: Double): Double

  30. def + (x: Float): Float

  31. def + (x: Long): Long

  32. def + (x: Int): Long

  33. def + (x: Char): Long

  34. def + (x: Short): Long

  35. def + (x: Byte): Long

  36. def + (x: String): String

  37. def - (x: Double): Double

  38. def - (x: Float): Float

  39. def - (x: Long): Long

  40. def - (x: Int): Long

  41. def - (x: Char): Long

  42. def - (x: Short): Long

  43. def - (x: Byte): Long

  44. def / (x: Double): Double

  45. def / (x: Float): Float

  46. def / (x: Long): Long

  47. def / (x: Int): Long

  48. def / (x: Char): Long

  49. def / (x: Short): Long

  50. def / (x: Byte): Long

  51. def < (x: Double): Boolean

  52. def < (x: Float): Boolean

  53. def < (x: Long): Boolean

  54. def < (x: Int): Boolean

  55. def < (x: Char): Boolean

  56. def < (x: Short): Boolean

  57. def < (x: Byte): Boolean

  58. def << (x: Long): Long

  59. def << (x: Int): Long

  60. def <= (x: Double): Boolean

  61. def <= (x: Float): Boolean

  62. def <= (x: Long): Boolean

  63. def <= (x: Int): Boolean

  64. def <= (x: Char): Boolean

  65. def <= (x: Short): Boolean

  66. def <= (x: Byte): Boolean

  67. def == (x: Double): Boolean

  68. def == (x: Float): Boolean

  69. def == (x: Long): Boolean

  70. def == (x: Int): Boolean

  71. def == (x: Char): Boolean

  72. def == (x: Short): Boolean

  73. def == (x: Byte): Boolean

  74. def == (arg0: Any): Boolean

    Test two objects for equality.

    Test two objects for equality.

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    Attributes
    final
    Definition Classes
    Any
  75. def > (x: Double): Boolean

  76. def > (x: Float): Boolean

  77. def > (x: Long): Boolean

  78. def > (x: Int): Boolean

  79. def > (x: Char): Boolean

  80. def > (x: Short): Boolean

  81. def > (x: Byte): Boolean

  82. def >= (x: Double): Boolean

  83. def >= (x: Float): Boolean

  84. def >= (x: Long): Boolean

  85. def >= (x: Int): Boolean

  86. def >= (x: Char): Boolean

  87. def >= (x: Short): Boolean

  88. def >= (x: Byte): Boolean

  89. def >> (x: Long): Long

  90. def >> (x: Int): Long

  91. def >>> (x: Long): Long

  92. def >>> (x: Int): Long

  93. def ^ (x: Long): Long

  94. def ^ (x: Int): Long

  95. def ^ (x: Char): Long

  96. def ^ (x: Short): Long

  97. def ^ (x: Byte): Long

  98. def asInstanceOf [T0] : T0

    Cast the receiver object to be of type T0.

    Cast the receiver object to be of type T0.

    Note that the success of a cast at runtime is modulo Scala's erasure semantics. Therefore the expression 1.asInstanceOf[String] will throw a ClassCastException at runtime, while the expression List(1).asInstanceOf[List[String]] will not. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested type.

    returns

    the receiver object.

    Attributes
    final
    Definition Classes
    Any
  99. def equals (arg0: Any): Boolean

    Compares the receiver object (this) with the argument object (that) for equivalence.

    Compares the receiver object (this) with the argument object (that) for equivalence.

    The default implementations of this method is an equivalence relation:

    • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
    • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
    • It is transitive: for any instances x, y, and z of type AnyRef if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

    If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same Int. (o1.hashCode.equals(o2.hashCode)).

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    Definition Classes
    Any
  100. def hashCode (): Int

    Calculate a hash code value for the object.

    Calculate a hash code value for the object.

    The default hashing algorithm is platform dependent.

    Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

    returns

    the hash code value for this object.

    Definition Classes
    Any
  101. def isInstanceOf [T0] : Boolean

    Test whether the dynamic type of the receiver object is T0.

    Test whether the dynamic type of the receiver object is T0.

    Note that the result of the test is modulo Scala's erasure semantics. Therefore the expression 1.isInstanceOf[String] will return false, while the expression List(1).isInstanceOf[List[String]] will return true. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the specified type.

    returns

    true if the receiver object is an instance of erasure of type T0; false otherwise.

    Attributes
    final
    Definition Classes
    Any
  102. def toByte : Byte

  103. def toChar : Char

  104. def toDouble : Double

  105. def toFloat : Float

  106. def toInt : Int

  107. def toLong : Long

  108. def toShort : Short

  109. def toString (): String

    Returns a string representation of the object.

    Returns a string representation of the object.

    The default representation is platform dependent.

    returns

    a string representation of the object.

    Definition Classes
    Any
  110. def unary_+ : Long

  111. def unary_- : Long

  112. def unary_~ : Long

  113. def | (x: Long): Long

  114. def | (x: Int): Long

  115. def | (x: Char): Long

  116. def | (x: Short): Long

  117. def | (x: Byte): Long

Inherited from AnyVal

Inherited from Any