summaryrefslogtreecommitdiff
path: root/src/library/scala/CaseClass.scala
blob: 07b766ede933cf090d3b110ce56a6b167c913d68 (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
32
33
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2002-2004, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |                                         **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
** $Id:CaseClass.scala 5359 2005-12-16 16:33:49 +0100 (Fri, 16 Dec 2005) dubochet $
\*                                                                      */

package scala;

/** defines an access function for instances of case classes
 *
 *  @author  Burak Emir
 */
trait CaseClass extends AnyRef {

  /** for a case class A(x_0,...,x_(k-1)), returns x_i for 0 <= i < k,
  **  null otherwise
  */
  def caseElement(n: Int): Any ;

  /** need also, for reflection
  def setCaseElement(n: Int, v: Any): unit
  */

  /** for a case class A(x_0,...,x_(k-1)), returns k
  */
  def caseArity: Int ;

  def caseName: String = ""; // for now

}