| Line 10... |
Line 10... |
| 10 |
\alias{selectMethod}
|
10 |
\alias{selectMethod}
|
| 11 |
\alias{hasMethod}
|
11 |
\alias{hasMethod}
|
| 12 |
\title{ Get or Test for the Definition of a Method }
|
12 |
\title{ Get or Test for the Definition of a Method }
|
| 13 |
\description{
|
13 |
\description{
|
| 14 |
Functions to look for a method corresponding to a given generic function and signature.
|
14 |
Functions to look for a method corresponding to a given generic function and signature.
|
| 15 |
The functions \code{getMethod} and \code{selectMethod} return the method; the functions \code{existsMethod}
|
15 |
The functions \code{getMethod} and \code{selectMethod} return the method; the functions
|
| 16 |
and \code{hasMethod} test for its existence. In both
|
16 |
\code{existsMethod} and \code{hasMethod} test for its existence. In both
|
| 17 |
cases the first function only gets direct definitions and the second
|
17 |
cases the first function only gets direct definitions and the second
|
| 18 |
uses inheritance. In all cases, the search is in the generic function itself or in the package/environment specified by argument \code{where}.
|
18 |
uses inheritance. In all cases, the search is in the generic function itself or in
|
| - |
|
19 |
the package/environment specified by argument \code{where}.
|
| 19 |
|
20 |
|
| 20 |
The function \code{findMethod} returns the package(s) in the search
|
21 |
The function \code{findMethod} returns the package(s) in the search
|
| 21 |
list (or in the packages specified by the \code{where} argument) that
|
22 |
list (or in the packages specified by the \code{where} argument) that
|
| 22 |
contain a method for this function and signature.
|
23 |
contain a method for this function and signature.
|
| 23 |
}
|
24 |
}
|
| Line 28... |
Line 29... |
| 28 |
existsMethod(f, signature = character(), where)
|
29 |
existsMethod(f, signature = character(), where)
|
| 29 |
|
30 |
|
| 30 |
findMethod(f, signature, where)
|
31 |
findMethod(f, signature, where)
|
| 31 |
|
32 |
|
| 32 |
selectMethod(f, signature, optional = FALSE, useInherited =,
|
33 |
selectMethod(f, signature, optional = FALSE, useInherited =,
|
| 33 |
mlist = , fdef = , verbose = , doCache = , returnAll =)
|
34 |
mlist = , fdef = , verbose = , doCache = )
|
| 34 |
|
35 |
|
| 35 |
hasMethod(f, signature=character(), where)
|
36 |
hasMethod(f, signature=character(), where)
|
| 36 |
|
37 |
|
| 37 |
}
|
38 |
}
|
| 38 |
\arguments{
|
39 |
\arguments{
|
| Line 45... |
Line 46... |
| 45 |
method(s): by default, the table of methods defined in the generic function itself is used.}
|
46 |
method(s): by default, the table of methods defined in the generic function itself is used.}
|
| 46 |
|
47 |
|
| 47 |
\item{optional}{If the selection in \code{selectMethod} does not find a valid method
|
48 |
\item{optional}{If the selection in \code{selectMethod} does not find a valid method
|
| 48 |
an error is generated, unless this argument is \code{TRUE}. In that
|
49 |
an error is generated, unless this argument is \code{TRUE}. In that
|
| 49 |
case, the value returned is \code{NULL} if no method matches.}
|
50 |
case, the value returned is \code{NULL} if no method matches.}
|
| 50 |
\item{mlist, fdef, useInherited, verbose, doCache, returnAll}{Optional
|
51 |
\item{mlist, fdef, useInherited, verbose, doCache}{Optional
|
| 51 |
arguments to \code{getMethod} and \code{selectMethod} for
|
52 |
arguments to \code{getMethod} and \code{selectMethod} for
|
| 52 |
internal use. Avoid
|
53 |
internal use. Avoid
|
| 53 |
these: some will work as expected and others will not, and none of them is required for normal use of the functions.
|
54 |
these: some will work as expected and others will not, and none of them is required for normal use of the functions.
|
| 54 |
}
|
55 |
}
|
| 55 |
|
56 |
|