| 42333 |
ripley |
1 |
% File src/library/methods/man/MethodDefinition-class.Rd
|
| 68948 |
ripley |
2 |
% Part of the R package, https://www.R-project.org
|
| 59039 |
ripley |
3 |
% Copyright 1995-2007 R Core Team
|
| 42333 |
ripley |
4 |
% Distributed under GPL 2 or later
|
|
|
5 |
|
| 19087 |
jmc |
6 |
\name{MethodDefinition-class}
|
|
|
7 |
\docType{class}
|
| 56186 |
murdoch |
8 |
\alias{MethodDefinition-class}
|
| 23898 |
jmc |
9 |
\alias{SealedMethodDefinition-class}
|
| 21544 |
ripley |
10 |
\title{Classes to Represent Method Definitions}
|
|
|
11 |
\description{
|
|
|
12 |
These classes extend the basic class \code{"function"} when
|
|
|
13 |
functions are to be stored and used as method definitions.
|
|
|
14 |
}
|
| 19087 |
jmc |
15 |
\section{Objects from the Class}{
|
| 23898 |
jmc |
16 |
The action of setting a method by a call to \code{\link{setMethod}} creates an object of this class. It's
|
| 21544 |
ripley |
17 |
unwise to create them directly.
|
| 23898 |
jmc |
18 |
|
|
|
19 |
The class \code{"SealedMethodDefinition"} is created by a call to
|
|
|
20 |
\code{\link{setMethod}} with argument \code{sealed = TRUE}. It has
|
|
|
21 |
the same representation as \code{"MethodDefinition"}.
|
| 19087 |
jmc |
22 |
}
|
|
|
23 |
\section{Slots}{
|
|
|
24 |
\describe{
|
|
|
25 |
\item{\code{.Data}:}{Object of class \code{"function"}; the data
|
|
|
26 |
part of the definition. }
|
|
|
27 |
\item{\code{target}:}{Object of class \code{"signature"}; the
|
|
|
28 |
signature for which the method was wanted. }
|
|
|
29 |
\item{\code{defined}:}{Object of class \code{"signature"}; the
|
|
|
30 |
signature for which a method was found. If the method was
|
|
|
31 |
inherited, this will not be identical to \code{target}. }
|
| 39016 |
jmc |
32 |
\item{\code{generic}:}{Object of class \code{"character"}; the function
|
| 44751 |
maechler |
33 |
for which the method was created. }
|
| 19087 |
jmc |
34 |
}
|
|
|
35 |
}
|
|
|
36 |
\section{Extends}{
|
| 21544 |
ripley |
37 |
Class \code{"function"}, from data part.\cr
|
|
|
38 |
Class \code{"PossibleMethod"}, directly.\cr
|
| 23531 |
hornik |
39 |
Class \code{"OptionalMethods"}, by class \code{"function"}.
|
| 19087 |
jmc |
40 |
}
|
| 20092 |
jmc |
41 |
\details{
|
|
|
42 |
Method definition objects are functions with additional information
|
|
|
43 |
defining how the function is being used as a method. The
|
|
|
44 |
\code{target} slot is the class signature for which the method will
|
|
|
45 |
be dispatched, and the \code{defined} slot the signature for which
|
| 40284 |
ripley |
46 |
the method was originally specified (that is, the one that appeared
|
| 20092 |
jmc |
47 |
in some call to \code{\link{setMethod}}).
|
| 19087 |
jmc |
48 |
}
|
| 44751 |
maechler |
49 |
\seealso{class \code{\linkS4class{MethodsList}} for the objects
|
| 20092 |
jmc |
50 |
defining sets of methods associated with a particular generic
|
|
|
51 |
function. The individual method definitions stored in these objects
|
|
|
52 |
are from class \code{MethodDefinition}, or an extension.
|
| 44751 |
maechler |
53 |
Class \code{\linkS4class{MethodWithNext}} for an extension used by
|
| 21544 |
ripley |
54 |
\code{\link{callNextMethod}}.
|
|
|
55 |
}
|
| 19087 |
jmc |
56 |
\keyword{classes}
|