summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-04-23 12:43:17 -0700
committerJason Zaugg <jzaugg@gmail.com>2013-04-23 12:43:17 -0700
commitadf7f9daf46e60d810b29119df388bc0aad9d3a6 (patch)
tree9aca6bbdbb797278b47d810230211dd5cf155242 /src/library
parentcd148d97225fc7738f7a8ff9d4479cd46d632371 (diff)
parent6f47cafcd3e62714e81aa30e940d63043cb61e64 (diff)
downloadscala-adf7f9daf46e60d810b29119df388bc0aad9d3a6.tar.gz
scala-adf7f9daf46e60d810b29119df388bc0aad9d3a6.tar.bz2
scala-adf7f9daf46e60d810b29119df388bc0aad9d3a6.zip
Merge pull request #2284 from demobox/add-box-unbox-doc-comment
SI-6898 Document AnyVal box and unbox implemention by BoxesRunTime
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/Boolean.scala6
-rw-r--r--src/library/scala/Byte.scala4
-rw-r--r--src/library/scala/Char.scala4
-rw-r--r--src/library/scala/Double.scala6
-rw-r--r--src/library/scala/Float.scala4
-rw-r--r--src/library/scala/Int.scala4
-rw-r--r--src/library/scala/Long.scala4
-rw-r--r--src/library/scala/Short.scala4
-rw-r--r--src/library/scala/Unit.scala3
9 files changed, 39 insertions, 0 deletions
diff --git a/src/library/scala/Boolean.scala b/src/library/scala/Boolean.scala
index e43b7d0a82..ddd11257c6 100644
--- a/src/library/scala/Boolean.scala
+++ b/src/library/scala/Boolean.scala
@@ -10,6 +10,8 @@
package scala
+import scala.language.implicitConversions
+
/** `Boolean` (equivalent to Java's `boolean` primitive type) is a
* subtype of [[scala.AnyVal]]. Instances of `Boolean` are not
* represented by an object in the underlying runtime system.
@@ -114,6 +116,8 @@ object Boolean extends AnyValCompanion {
/** Transform a value type into a boxed reference type.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.boxToBoolean`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the Boolean to be boxed
* @return a java.lang.Boolean offering `x` as its underlying value.
*/
@@ -123,6 +127,8 @@ object Boolean extends AnyValCompanion {
* method is not typesafe: it accepts any Object, but will throw
* an exception if the argument is not a java.lang.Boolean.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.unboxToBoolean`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the java.lang.Boolean to be unboxed.
* @throws ClassCastException if the argument is not a java.lang.Boolean
* @return the Boolean resulting from calling booleanValue() on `x`
diff --git a/src/library/scala/Byte.scala b/src/library/scala/Byte.scala
index d1979236d3..2510e859c0 100644
--- a/src/library/scala/Byte.scala
+++ b/src/library/scala/Byte.scala
@@ -606,6 +606,8 @@ object Byte extends AnyValCompanion {
/** Transform a value type into a boxed reference type.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.boxToByte`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the Byte to be boxed
* @return a java.lang.Byte offering `x` as its underlying value.
*/
@@ -615,6 +617,8 @@ object Byte extends AnyValCompanion {
* method is not typesafe: it accepts any Object, but will throw
* an exception if the argument is not a java.lang.Byte.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.unboxToByte`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the java.lang.Byte to be unboxed.
* @throws ClassCastException if the argument is not a java.lang.Byte
* @return the Byte resulting from calling byteValue() on `x`
diff --git a/src/library/scala/Char.scala b/src/library/scala/Char.scala
index 00ddff5b3b..1c9a2ba44f 100644
--- a/src/library/scala/Char.scala
+++ b/src/library/scala/Char.scala
@@ -606,6 +606,8 @@ object Char extends AnyValCompanion {
/** Transform a value type into a boxed reference type.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.boxToCharacter`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the Char to be boxed
* @return a java.lang.Character offering `x` as its underlying value.
*/
@@ -615,6 +617,8 @@ object Char extends AnyValCompanion {
* method is not typesafe: it accepts any Object, but will throw
* an exception if the argument is not a java.lang.Character.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.unboxToChar`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the java.lang.Character to be unboxed.
* @throws ClassCastException if the argument is not a java.lang.Character
* @return the Char resulting from calling charValue() on `x`
diff --git a/src/library/scala/Double.scala b/src/library/scala/Double.scala
index 85bf9fe5c5..ce081bbec1 100644
--- a/src/library/scala/Double.scala
+++ b/src/library/scala/Double.scala
@@ -10,6 +10,8 @@
package scala
+import scala.language.implicitConversions
+
/** `Double`, a 64-bit IEEE-754 floating point number (equivalent to Java's `double` primitive type) is a
* subtype of [[scala.AnyVal]]. Instances of `Double` are not
* represented by an object in the underlying runtime system.
@@ -380,6 +382,8 @@ object Double extends AnyValCompanion {
/** Transform a value type into a boxed reference type.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.boxToDouble`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the Double to be boxed
* @return a java.lang.Double offering `x` as its underlying value.
*/
@@ -389,6 +393,8 @@ object Double extends AnyValCompanion {
* method is not typesafe: it accepts any Object, but will throw
* an exception if the argument is not a java.lang.Double.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.unboxToDouble`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the java.lang.Double to be unboxed.
* @throws ClassCastException if the argument is not a java.lang.Double
* @return the Double resulting from calling doubleValue() on `x`
diff --git a/src/library/scala/Float.scala b/src/library/scala/Float.scala
index f67f45897f..4ff2d509b8 100644
--- a/src/library/scala/Float.scala
+++ b/src/library/scala/Float.scala
@@ -382,6 +382,8 @@ object Float extends AnyValCompanion {
/** Transform a value type into a boxed reference type.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.boxToFloat`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the Float to be boxed
* @return a java.lang.Float offering `x` as its underlying value.
*/
@@ -391,6 +393,8 @@ object Float extends AnyValCompanion {
* method is not typesafe: it accepts any Object, but will throw
* an exception if the argument is not a java.lang.Float.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.unboxToFloat`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the java.lang.Float to be unboxed.
* @throws ClassCastException if the argument is not a java.lang.Float
* @return the Float resulting from calling floatValue() on `x`
diff --git a/src/library/scala/Int.scala b/src/library/scala/Int.scala
index 1bacdbcee9..6a27195b10 100644
--- a/src/library/scala/Int.scala
+++ b/src/library/scala/Int.scala
@@ -606,6 +606,8 @@ object Int extends AnyValCompanion {
/** Transform a value type into a boxed reference type.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.boxToInteger`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the Int to be boxed
* @return a java.lang.Integer offering `x` as its underlying value.
*/
@@ -615,6 +617,8 @@ object Int extends AnyValCompanion {
* method is not typesafe: it accepts any Object, but will throw
* an exception if the argument is not a java.lang.Integer.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.unboxToInt`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the java.lang.Integer to be unboxed.
* @throws ClassCastException if the argument is not a java.lang.Integer
* @return the Int resulting from calling intValue() on `x`
diff --git a/src/library/scala/Long.scala b/src/library/scala/Long.scala
index 83adcda819..4d369ae010 100644
--- a/src/library/scala/Long.scala
+++ b/src/library/scala/Long.scala
@@ -606,6 +606,8 @@ object Long extends AnyValCompanion {
/** Transform a value type into a boxed reference type.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.boxToLong`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the Long to be boxed
* @return a java.lang.Long offering `x` as its underlying value.
*/
@@ -615,6 +617,8 @@ object Long extends AnyValCompanion {
* method is not typesafe: it accepts any Object, but will throw
* an exception if the argument is not a java.lang.Long.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.unboxToLong`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the java.lang.Long to be unboxed.
* @throws ClassCastException if the argument is not a java.lang.Long
* @return the Long resulting from calling longValue() on `x`
diff --git a/src/library/scala/Short.scala b/src/library/scala/Short.scala
index cdd298e542..4f91c51550 100644
--- a/src/library/scala/Short.scala
+++ b/src/library/scala/Short.scala
@@ -606,6 +606,8 @@ object Short extends AnyValCompanion {
/** Transform a value type into a boxed reference type.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.boxToShort`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the Short to be boxed
* @return a java.lang.Short offering `x` as its underlying value.
*/
@@ -615,6 +617,8 @@ object Short extends AnyValCompanion {
* method is not typesafe: it accepts any Object, but will throw
* an exception if the argument is not a java.lang.Short.
*
+ * Runtime implementation determined by `scala.runtime.BoxesRunTime.unboxToShort`. See [[https://github.com/scala/scala src/library/scala/runtime/BoxesRunTime.java]].
+ *
* @param x the java.lang.Short to be unboxed.
* @throws ClassCastException if the argument is not a java.lang.Short
* @return the Short resulting from calling shortValue() on `x`
diff --git a/src/library/scala/Unit.scala b/src/library/scala/Unit.scala
index 01e592ec3c..0e59a184d1 100644
--- a/src/library/scala/Unit.scala
+++ b/src/library/scala/Unit.scala
@@ -10,6 +10,9 @@
package scala
+import scala.language.implicitConversions
+
+
/** `Unit` is a subtype of [[scala.AnyVal]]. There is only one value of type
* `Unit`, `()`, and it is not represented by any object in the underlying
* runtime system. A method with return type `Unit` is analogous to a Java