Product

scala.Product
trait Product extends Equals

Base trait for all products, which in the standard library include at least scala.Product1 through scala.Product22 and therefore also their subclasses scala.Tuple1 through scala.Tuple22. In addition, all case classes implement Product with synthetically generated methods.

Attributes

Source:
Product.scala
Graph
Supertypes
trait Equals
class Any
Known subtypes
class Option[A]
object None.type
class Some[A]
trait Product1[T1]
class (T1)
trait Product10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]
class (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
trait Product11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]
class (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
trait Product12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]
class (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)
trait Product13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]
class (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)
trait Product14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]
class (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)
trait Product15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]
class (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)
trait Product16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]
class (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)
trait Product17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]
class (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17)
trait Product18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]
class (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)
trait Product19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]
class (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19)
trait Product2[T1, T2]
class (T1, T2)
trait Product20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20]
class (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20)
trait Product21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21]
class (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21)
trait Product22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22]
class (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22)
trait Product3[T1, T2, T3]
class (T1, T2, T3)
trait Product4[T1, T2, T3, T4]
class (T1, T2, T3, T4)
trait Product5[T1, T2, T3, T4, T5]
class (T1, T2, T3, T4, T5)
trait Product6[T1, T2, T3, T4, T5, T6]
class (T1, T2, T3, T4, T5, T6)
trait Product7[T1, T2, T3, T4, T5, T6, T7]
class (T1, T2, T3, T4, T5, T6, T7)
trait Product8[T1, T2, T3, T4, T5, T6, T7, T8]
class (T1, T2, T3, T4, T5, T6, T7, T8)
trait Product9[T1, T2, T3, T4, T5, T6, T7, T8, T9]
class (T1, T2, T3, T4, T5, T6, T7, T8, T9)
trait Tuple
object EmptyTuple.type
class H *: T
trait Enum
trait EnumValue
class TupleXXL
class Either[A, B]
class Left[A, B]
class Right[A, B]
class Try[T]
class Failure[T]
class Success[T]

Members list

Concise view

Value members

Abstract methods

The size of this product.

The size of this product.

Attributes

Returns:

for a product A(x1, ..., xk), returns k

Source:
Product.scala

The nth element of this product, 0-based.

The nth element of this product, 0-based. In other words, for a product A(x1, ..., xk), returns x(n+1) where 0 <= n < k.

Attributes

n

the index of the element to return

Returns:

the element n elements after the first element

Throws:

IndexOutOfBoundsException if the n is out of range(n < 0 || n >= productArity).

Source:
Product.scala

Concrete methods

The name of the nth element of this product, 0-based.

The name of the nth element of this product, 0-based. In the default implementation, an empty string.

Attributes

n

the index of the element name to return

Returns:

the name of the specified element

Throws:

IndexOutOfBoundsException if the n is out of range(n < 0 || n >= productArity).

Source:
Product.scala

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Source:
Product.scala

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns:

in the default implementation, an Iterator[Any]

Source:
Product.scala

A string used in the toString methods of derived classes.

A string used in the toString methods of derived classes. Implementations may override this method to prepend a string prefix to the result of toString methods.

Attributes

Returns:

in the default implementation, the empty string

Source:
Product.scala

Inherited methods

def canEqual(that: Any): Boolean

A method that should be called from every well-designed equals method that is open to be overridden in a subclass.

A method that should be called from every well-designed equals method that is open to be overridden in a subclass. See Programming in Scala, Chapter 28 for discussion and design.

Attributes

that

the value being probed for possible equality

Returns:

true if this instance can possibly equal that, otherwise false

Inherited from:
Equals
Source:
Equals.scala