Specialized

class Specialized[A]

Specialized instance determines custom implementation of given type containers. Usually it is used by inlined methods and gets resolved by the compiler, so threre is zero runtime cost.

For example, consider specialized stream method map, which returns different types of stream:

 val floats  : Float.Stream   =  (1 <> 9).stream.map(_.toFloat)

 val longs   : Long.Stream    =  (1 <> 9).stream.map(_.toLong)

 val strings : Stream[String] =  (1 <> 9).stream.map(_.toString)
Source
__.scala
class java.lang.Object
trait scala.Matchable
class Any
class Specialized.Primitive[Specialized.Primitive.A]
class Specialized.X.Boolean[Specialized.X.Boolean.A]
class Specialized.X.Byte[Specialized.X.Byte.A]
class Specialized.X.Char[Specialized.X.Char.A]
class Specialized.X.Short[Specialized.X.Short.A]
class Specialized.X.Int[Specialized.X.Int.A]
class Specialized.X.Long[Specialized.X.Long.A]
class Specialized.X.Float[Specialized.X.Float.A]
class Specialized.X.Double[Specialized.X.Double.A]
class Specialized.X.AnyRef[Specialized.X.AnyRef.A]

Type

type Array <: Any.Array[A]
Source
__.scala
type Buffer <: Any.Buffer[A]
Source
__.scala
type Idx <: Any.Idx[A]
Source
__.scala
type Lookup[B] <: Any.Lookup[A, B]
Source
__.scala
type Opt <: Any.Opt[A]
Source
__.scala
type Pack <: Any.Pack[A]
Source
__.scala
type Pro <: Any.Pro[A]
Source
__.scala
type Range <: Any.Range[A]
Source
__.scala
type Set <: Any.Set[A]
Source
__.scala
type Stream <: Any.Stream[A]
Source
__.scala