summaryrefslogtreecommitdiff
path: root/src/library/scala/Tuple2.scala
blob: 11acdfec7de202b6653b7f11d2278e73e376ea33 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2002-2008, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

// $Id$

// generated by genprod on Tue Apr 22 16:48:01 CEST 2008  (with extra methods)

package scala

/** Tuple2 is the canonical representation of a @see Product2
 *
 */
case class Tuple2[+T1, +T2](_1:T1, _2:T2)
  extends Product2[T1, T2]  {

   override def toString() = {
     val sb = new StringBuilder
     sb.append('(').append(_1).append(',').append(_2).append(')')
     sb.toString
   }

  /** Swap the elements of the tuple */
  def swap: Tuple2[T2,T1] = Tuple2(_2, _1)

}