Class

scala

Tuple2

Related Doc: package scala

Permalink

case class Tuple2[+T1, +T2](_1: T1, _2: T2) extends Product2[T1, T2] with Product with Serializable

A tuple of 2 elements; the canonical representation of a scala.Product2.

_1

Element 1 of this Tuple2

_2

Element 2 of this Tuple2

Annotations
@deprecatedInheritance( ... , "2.11.0" )
Linear Supertypes
Serializable, java.io.Serializable, Product2[T1, T2], Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Tuple2
  2. Serializable
  3. Serializable
  4. Product2
  5. Product
  6. Equals
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Tuple2(_1: T1, _2: T2)

    Permalink

    Create a new tuple with 2 elements.

    Create a new tuple with 2 elements. Note that it is more idiomatic to create a Tuple2 via (t1, t2)

    _1

    Element 1 of this Tuple2

    _2

    Element 2 of this Tuple2

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val _1: T1

    Permalink

    Element 1 of this Tuple2

    Element 1 of this Tuple2

    Definition Classes
    Tuple2Product2
  5. val _2: T2

    Permalink

    Element 2 of this Tuple2

    Element 2 of this Tuple2

    Definition Classes
    Tuple2Product2
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. def productArity: Int

    Permalink

    The arity of this product.

    The arity of this product.

    returns

    2

    Definition Classes
    Product2Product
  16. def productElement(n: Int): Any

    Permalink

    Returns the n-th projection of this product if 0 <= n < productArity, otherwise throws an IndexOutOfBoundsException.

    Returns the n-th projection of this product if 0 <= n < productArity, otherwise throws an IndexOutOfBoundsException.

    n

    number of the projection to be returned

    returns

    same as ._(n+1), for example productElement(0) is the same as ._1.

    Definition Classes
    Product2Product
    Annotations
    @throws( clazz = classOf[IndexOutOfBoundsException] )
    Exceptions thrown
  17. def swap: (T2, T1)

    Permalink

    Swaps the elements of this Tuple.

    Swaps the elements of this Tuple.

    returns

    a new Tuple where the first element is the second element of this Tuple and the second element is the first element of this Tuple.

  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  19. def toString(): String

    Permalink
    Definition Classes
    Tuple2 → AnyRef → Any
  20. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from java.io.Serializable

Inherited from Product2[T1, T2]

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped