ScalaRunTime

scala.runtime.ScalaRunTime
object ScalaRunTime

The object ScalaRunTime provides support methods required by the scala runtime. All these methods should be considered outside the API and subject to change or removal without notice.

Attributes

Source
ScalaRunTime.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def _hashCode(x: Product): Int

Attributes

Source
ScalaRunTime.scala

Attributes

Source
ScalaRunTime.scala
def anyValClass[T <: AnyVal : ClassTag](value: T): Class[T]

Returns the class object representing an unboxed value type, e.g., classOf[int], not classOf[java.lang.Integer]. The compiler rewrites expressions like 5.getClass to come here.

Returns the class object representing an unboxed value type, e.g., classOf[int], not classOf[java.lang.Integer]. The compiler rewrites expressions like 5.getClass to come here.

Type parameters

T

the value type whose runtime class is retrieved

Value parameters

value

the boxed value whose unboxed class is returned

Attributes

Returns

the runtime Class representing the unboxed type T

Source
ScalaRunTime.scala
def arrayClass(clazz: Class[_]): Class[_]

Returns the class object representing an array with element class clazz.

Returns the class object representing an array with element class clazz.

Value parameters

clazz

the element class of the desired array type

Attributes

Returns

the Class object representing Array[clazz]

Source
ScalaRunTime.scala
def array_apply(xs: AnyRef, idx: Int): Any

Retrieves generic array element.

Retrieves generic array element.

Value parameters

idx

the index of the element to retrieve

xs

the array to read from (typed as AnyRef to support both reference and primitive arrays)

Attributes

Returns

the element at position idx in the array

Source
ScalaRunTime.scala

Attributes

Source
ScalaRunTime.scala
def array_length(xs: AnyRef): Int

Gets generic array length.

Gets generic array length.

Value parameters

xs

the array to measure, as an AnyRef

Attributes

Returns

the number of elements in the array

Source
ScalaRunTime.scala
def array_update(xs: AnyRef, idx: Int, value: Any): Unit

Updates generic array element.

Updates generic array element.

Value parameters

idx

the index of the element to set

value

the value to store at the given index

xs

the array to update (typed as AnyRef to support both reference and primitive arrays)

Attributes

Source
ScalaRunTime.scala
def drop[Repr](coll: Repr, num: Int)(implicit iterable: IsIterable[Repr] { type C <: Repr; }): Repr

Attributes

Source
ScalaRunTime.scala

Attributes

Source
ScalaRunTime.scala
def genericWrapArray[T](xs: Array[T]): ArraySeq[T]

Attributes

Source
ScalaRunTime.scala
def isArray(x: Any, atLevel: Int = ...): Boolean

Attributes

Source
ScalaRunTime.scala
def replStringOf(arg: Any, maxElements: Int): String

stringOf formatted for use in a repl result.

stringOf formatted for use in a repl result.

Value parameters

arg

the value to convert to its string representation

maxElements

the maximum number of collection elements to include

Attributes

Returns

a string representation of arg, formatted for REPL display

Source
ScalaRunTime.scala
def stringOf(arg: Any): String

Given any Scala value, convert it to a String.

Given any Scala value, convert it to a String.

The primary motivation for this method is to provide a means for correctly obtaining a String representation of a value, while avoiding the pitfalls of naively calling toString on said value. In particular, it addresses the fact that (a) toString cannot be called on null and (b) depending on the apparent type of an array, toString may or may not print it in a human-readable form.

Value parameters

arg

the value to stringify

Attributes

Returns

a string representation of arg.

Source
ScalaRunTime.scala
def stringOf(arg: Any, maxElements: Int): String

Attributes

Source
ScalaRunTime.scala
def toArray[T](xs: Seq[T]): Array[AnyRef]

Attributes

Source
ScalaRunTime.scala

Converts an array to an object array. Needed to deal with vararg arguments of primitive types that are passed to a generic Java vararg parameter T ...

Converts an array to an object array. Needed to deal with vararg arguments of primitive types that are passed to a generic Java vararg parameter T ...

Value parameters

src

the source array to convert, which may be a primitive array

Attributes

Returns

an Array[Object] containing the (boxed) elements of src

Source
ScalaRunTime.scala

A helper for case classes.

A helper for case classes.

Type parameters

T

the expected element type; elements are cast to this type without checking

Value parameters

x

the product whose elements are iterated over

Attributes

Returns

an iterator over the product's elements, cast to type T

Source
ScalaRunTime.scala

Attributes

Source
ScalaRunTime.scala

Attributes

Source
ScalaRunTime.scala

Attributes

Source
ScalaRunTime.scala

Attributes

Source
ScalaRunTime.scala

Attributes

Source
ScalaRunTime.scala
def wrapRefArray[T <: AnyRef | Null](xs: Array[T]): ArraySeq[T]

Attributes

Source
ScalaRunTime.scala

Attributes

Source
ScalaRunTime.scala

Attributes

Source
ScalaRunTime.scala