Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 48 lines (38 sloc) 1.565 kB
21808a3 unapply patch
Burak Emir authored
1 /* __ *\
2 ** ________ ___ / / ___ Scala API **
2d11a5b Updated copyright notices to 2011
Antonio Cunei authored
3 ** / __/ __// _ | / / / _ | (c) 2002-2011, LAMP/EPFL **
7b2bdb4 updated element/arity to productElement/product...
michelou authored
4 ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
21808a3 unapply patch
Burak Emir authored
5 ** /____/\___/_/ |_/____/_/ | | **
6 ** |/ **
7 \* */
fd1ca1e Moved unlift to the Function companion object, ...
Paul Phillips authored
8 // GENERATED CODE: DO NOT EDIT. See scala.Function0 for timestamp.
1e5fd9b updated genprod.scala (Function1)
michelou authored
9
21808a3 unapply patch
Burak Emir authored
10 package scala
11
6c468e8 more fun with positions, and updated doc
Burak Emir authored
12 object Product1 {
02a45e2
Burak Emir authored
13 def unapply[T1](x: Product1[T1]): Option[Product1[T1]] =
bfea9f2 * TupleN extends ProductN, again (genprod updated)
Burak Emir authored
14 Some(x)
6c468e8 more fun with positions, and updated doc
Burak Emir authored
15 }
16
e586732 Newly generated Tuple/Product/Function classes ...
Paul Phillips authored
17 /** Product1 is a cartesian product of 1 component.
de8ca77 add @since scaladoc tag to scala.* types
stepancheg authored
18 * @since 2.3
1e23988 caseclass->product
Burak Emir authored
19 */
1e92776 @odersky Fixes to value classes: Flags now double definitions, private constru…
odersky authored
20 trait Product1[@specialized(Int, Long, Double) +T1] extends Any with Product {
fd1ca1e Moved unlift to the Function companion object, ...
Paul Phillips authored
21 /** The arity of this product.
1e23988 caseclass->product
Burak Emir authored
22 * @return 1
23 */
5bb26aa renamed arity=>productArity,element=>productEle...
Burak Emir authored
24 override def productArity = 1
25
1e92776 @odersky Fixes to value classes: Flags now double definitions, private constru…
odersky authored
26
fd1ca1e Moved unlift to the Function companion object, ...
Paul Phillips authored
27 /** Returns the n-th projection of this product if 0 < n <= productArity,
28 * otherwise throws an `IndexOutOfBoundsException`.
5bb26aa renamed arity=>productArity,element=>productEle...
Burak Emir authored
29 *
30 * @param n number of the projection to be returned
c3b0113 @kzys Fix a documentation comment of Product(n)#productElement
kzys authored
31 * @return same as `._(n+1)`, for example `productElement(0)` is the same as `._1`.
5bb26aa renamed arity=>productArity,element=>productEle...
Burak Emir authored
32 * @throws IndexOutOfBoundsException
33 */
5cdb213 Documentation being generated by genprod was pr...
Paul Phillips authored
34
92ec9e2 Improvements to genprod
Geoffrey Washburn authored
35 @throws(classOf[IndexOutOfBoundsException])
1e92776 @odersky Fixes to value classes: Flags now double definitions, private constru…
odersky authored
36 override def productElement(n: Int) = n match {
61ef5c8 product.element index starts with 0
Burak Emir authored
37 case 0 => _1
1e23988 caseclass->product
Burak Emir authored
38 case _ => throw new IndexOutOfBoundsException(n.toString())
e586732 Newly generated Tuple/Product/Function classes ...
Paul Phillips authored
39 }
1e23988 caseclass->product
Burak Emir authored
40
fd1ca1e Moved unlift to the Function companion object, ...
Paul Phillips authored
41 /** A projection of element 1 of this Product.
42 * @return A projection of element 1.
43 */
bfea9f2 * TupleN extends ProductN, again (genprod updated)
Burak Emir authored
44 def _1: T1
21808a3 unapply patch
Burak Emir authored
45
1e23988 caseclass->product
Burak Emir authored
46
21808a3 unapply patch
Burak Emir authored
47 }
Something went wrong with that request. Please try again.