summaryrefslogtreecommitdiff
path: root/src/library/scala/CaseClass.scala
blob: d50220f737192c3a4d3be384a0999960b2a06330 (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
34
35
36
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2002-2006, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |                                         **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

// $Id$


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 ;

}