The R Project SVN R

Rev

Rev 56186 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
42333 ripley 1
% File src/library/methods/man/classRepresentation-class.Rd
2
% Part of the R package, http://www.R-project.org
59039 ripley 3
% Copyright 1995-2007 R Core Team
42333 ripley 4
% Distributed under GPL 2 or later
5
 
20620 jmc 6
\name{classRepresentation-class}
7
\docType{class}
56186 murdoch 8
\alias{classRepresentation-class}
20620 jmc 9
\title{Class Objects }
10
\description{  These are the objects that hold the definition of
11
  classes of objects.  They are constructed and stored as meta-data by
12
  calls to the function \code{\link{setClass}}.  Don't manipulate them
13
  directly, except perhaps to look at individual slots. }
14
 
15
\section{Slots}{
16
  \describe{
17
    \item{\code{slots}:}{A named list of the slots in this class; the
23531 hornik 18
      elements of the list are the classes to which the slots must
19
      belong (or extend), and the names of the list gives the
20
      corresponding slot names.}
20620 jmc 21
    \item{\code{contains}:}{A named list of the classes this class
42963 ripley 22
      \sQuote{contains}; the elements of the list are objects of
44751 maechler 23
      \code{\linkS4class{SClassExtension}}. The list may be only the
23531 hornik 24
      direct extensions or all the currently known extensions (see the
25
      details).}
20620 jmc 26
    \item{\code{virtual}:}{Logical flag, set to \code{TRUE} if this is
23531 hornik 27
      a virtual class.}
20620 jmc 28
    \item{\code{prototype}:}{The object that represents the standard
23531 hornik 29
      prototype for this class; i.e., the data and slots returned by a
30
      call to \code{\link{new}} for this class with no special
31
      arguments.  Don't mess with the prototype object directly.}
20620 jmc 32
    \item{\code{validity}:}{Optionally, a function to be used to test
23531 hornik 33
      the validity of objects from this class.
34
      See \code{\link{validObject}}.}
35
    \item{\code{access}:}{Access control information.  Not currently used.}
36
    \item{\code{className}:}{The character string name of the class.}
20620 jmc 37
    \item{\code{package}:}{The character string name of the package to
23531 hornik 38
      which the class belongs.  Nearly always the package on which the
39
      metadata for the class is stored, but in operations such as
40
      constructing inheritance information, the internal package name
44751 maechler 41
      rules.}
20620 jmc 42
    \item{\code{subclasses}:}{A named list of the classes known to
44751 maechler 43
      extend this class'; the elements of the list are objects of class
44
      \code{\linkS4class{SClassExtension}}.  The list is currently only
23531 hornik 45
      filled in when completing the class definition (see the details).}
20620 jmc 46
    \item{\code{versionKey}:}{Object of class \code{"externalptr"};
23531 hornik 47
      eventually will perhaps hold some versioning information, but not
48
      currently used. }
20620 jmc 49
    \item{\code{sealed}:}{Object of class \code{"logical"}; is this
23531 hornik 50
      class sealed?  If so, no modifications are allowed. }
20620 jmc 51
  }
52
}
53
\details{
23531 hornik 54
  Class definitions are stored as metadata in various packages.
55
  Additional metadata supplies information on inheritance (the result of
56
  calls to \code{\link{setIs}}).  Inheritance information implied by the
57
  class definition itself (because the class contains one or more other
58
  classes) is also constructed automatically.
20620 jmc 59
 
23531 hornik 60
  When a class is to be used in an R session, this information is
61
  assembled to complete the class definition.  The completion is a
62
  second object of class \code{"classRepresentation"}, cached for the
63
  session or until something happens to change the information.  A call
64
  to \code{\link{getClass}} returns the completed definition of a class;
65
  a call to \code{\link{getClassDef}} returns the stored definition
66
  (uncompleted).
20620 jmc 67
 
23531 hornik 68
  In particular, completion fills in the upward- and downward-pointing
69
  inheritance information for the class, in slots \code{contains} and
70
  \code{subclasses} respectively.  It's in principle important to note
71
  that this information can depend on which packages are installed,
72
  since these may define additional subclasses or superclasses.
20620 jmc 73
}
23531 hornik 74
\seealso{
75
  See function \code{\link{setClass}} to supply the information in the
76
  class definition.
77
  See \link{Classes} for a more basic discussion of class information.
20620 jmc 78
}
79
\keyword{classes}