| 42333 |
ripley |
1 |
% File src/library/methods/man/MethodSupport.Rd
|
| 68948 |
ripley |
2 |
% Part of the R package, https://www.R-project.org
|
| 59039 |
ripley |
3 |
% Copyright 1995-2009 R Core Team
|
| 42333 |
ripley |
4 |
% Distributed under GPL 2 or later
|
|
|
5 |
|
| 15431 |
jmc |
6 |
\name{MethodSupport}
|
| 45884 |
maechler |
7 |
\title{Additional (Support) Functions for Methods}
|
| 15431 |
jmc |
8 |
\alias{getMethodsForDispatch}
|
| 16559 |
jmc |
9 |
\alias{cacheMethod}
|
| 15431 |
jmc |
10 |
\alias{resetGeneric}
|
| 40191 |
jmc |
11 |
\alias{listFromMethods}
|
| 19029 |
hornik |
12 |
\description{
|
| 70273 |
maechler |
13 |
These are \emph{internal} support routines for computations on formal methods.
|
| 19029 |
hornik |
14 |
}
|
| 15431 |
jmc |
15 |
\usage{
|
| 40191 |
jmc |
16 |
listFromMethods(generic, where, table)
|
|
|
17 |
|
| 45884 |
maechler |
18 |
getMethodsForDispatch(fdef, inherited = FALSE)
|
| 15431 |
jmc |
19 |
|
| 39775 |
jmc |
20 |
cacheMethod(f, sig, def, args, fdef, inherited = FALSE)
|
| 16559 |
jmc |
21 |
|
| 25816 |
jmc |
22 |
resetGeneric(f, fdef, mlist, where, deflt)
|
| 15431 |
jmc |
23 |
}
|
| 17211 |
jmc |
24 |
\section{Summary of Functions}{
|
| 19029 |
hornik |
25 |
\describe{
|
| 43747 |
maechler |
26 |
\item{\code{listFromMethods}:}{
|
| 46128 |
jmc |
27 |
A list object describing the methods for the function \code{generic}, supplied either as the function or the name of the function. For user code, the function \code{\link{findMethods}} or \code{\link{findMethodSignatures}} is recommended instead, returning a simple list of methods or a character matrix of the signatures.
|
| 40191 |
jmc |
28 |
|
| 46128 |
jmc |
29 |
If \code{where} is supplied, this should be an environment or search list position from which a table of methods for the generic will be taken. If \code{table} is supplied, this is itself assumed to be such a table. If neither argument is supplied, the table is taken directly from the generic function (that is, the current set of methods defined for this generic).
|
|
|
30 |
|
| 44751 |
maechler |
31 |
Returns an object of class \code{"LinearMethodsList"} (see
|
|
|
32 |
\linkS4class{LinearMethodsList}) describing all the methods in the
|
|
|
33 |
relevant table.
|
| 40191 |
jmc |
34 |
}
|
| 43747 |
maechler |
35 |
\item{\code{resetGeneric}:}{
|
| 49719 |
maechler |
36 |
reset the currently defined methods for the generic function named
|
|
|
37 |
\code{f}, found in environment \code{where} or explicitly supplied
|
|
|
38 |
as an argument. Other arguments are obsolete and ignored.
|
| 15431 |
jmc |
39 |
|
| 49719 |
maechler |
40 |
Called for its side effect of resetting all inherited methods in
|
|
|
41 |
the generic function's internal table.
|
| 46128 |
jmc |
42 |
Normally not called directly, since changes to methods and the
|
| 49719 |
maechler |
43 |
loading and detaching of packages all generate a call automatically.
|
| 19029 |
hornik |
44 |
}
|
|
|
45 |
\item{\code{cacheMethod}:}{
|
|
|
46 |
Store the definition for this function and signature in the method
|
|
|
47 |
metadata for the function. Used to store extensions of coerce
|
| 39775 |
jmc |
48 |
methods found through inheritance, and to cache methods with
|
|
|
49 |
\code{\link{callNextMethod}} information.
|
| 15431 |
jmc |
50 |
|
| 19029 |
hornik |
51 |
No persistent effect, since the method metadata is session-scope
|
|
|
52 |
only.
|
|
|
53 |
}
|
|
|
54 |
\item{\code{getMethodsForDispatch}:}{
|
| 49719 |
maechler |
55 |
Get the table of methods (an \code{\link{environment}} since R
|
|
|
56 |
version 2.6.0) representing the methods for function \code{f}.
|
|
|
57 |
|
|
|
58 |
For user code, the function \code{\link{findMethods}} or
|
|
|
59 |
\code{\link{findMethodSignatures}} is recommended instead, returning
|
|
|
60 |
a simple list of methods or a character matrix of the signatures.
|
| 19029 |
hornik |
61 |
}
|
| 16559 |
jmc |
62 |
}
|
| 15431 |
jmc |
63 |
}
|
| 16802 |
jmc |
64 |
\keyword{internal}
|