Element 1 of this Tuple2
Element 2 of this Tuple2
A method that should be called from every well-designed equals method that is open to be overridden in a subclass.
The universal equality method defined in AnyRef
.
The hashCode method for reference types.
The arity of this product.
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
.
number of the projection to be returned
same as ._(n+1)
, for example productElement(1)
is the same as ._1
.
An iterator over all the elements of this product.
An iterator over all the elements of this product.
in the default implementation, an Iterator[Any]
A string used in the toString
methods of derived classes.
Swaps the elements of this Tuple
.
Swaps the elements of this Tuple
.
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.
Creates a String representation of this object.
Wraps a tuple in a Zipped
, which supports 2-ary generalisations of map
, flatMap
, filter
, etc.
Wraps a tuple in a Zipped
, which supports 2-ary generalisations of map
, flatMap
, filter
, etc.
Note that there must be an implicit value to convert this tuple's types into a TraversableLike
or IterableLike.
scala> val tuple = (List(1,2,3),List('a','b','c')) tuple: (List[Int], List[Char]) = (List(1, 2, 3),List(a, b, c)) scala> tuple.zipped map { (x,y) => x + ":" + y } res6: List[java.lang.String] = List(1:a, 2:b, 3:c)
Zipped Note: will not terminate for infinite-sized collections.
use productIterator instead
Use zipped
instead.
A tuple of 2 elements; the canonical representation of a Product2.
Element 1 of this Tuple2
Element 2 of this Tuple2