The R Project SVN R

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
42333 ripley 1
% File src/library/methods/man/MethodsList-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
 
17376 jmc 6
\name{MethodsList-class}
56186 murdoch 7
\alias{MethodsList-class}
25816 jmc 8
\alias{body<-,MethodDefinition-method}
19123 hornik 9
\docType{class}
51304 jmc 10
\title{Class MethodsList, Deprecated Representation of Methods }
11
\description{ This class of objects was used in the original
12
  implementation of the package to control method dispatch.  Its use
13
  is now deprecated, but object appear as the default method slot in
14
  generic functions.  This and any other remaining uses will be
15
  removed in the future.
16
 
17
 For the modern alternative, see \linkS4class{listOfMethods}.
18
 
19
The details in this documentation are retained to allow analysis of
20
old-style objects. }
19064 jmc 21
\section{Slots}{\describe{
22
 
19123 hornik 23
  \item{\code{argument}:}{Object of class \code{"name"}.  The name of the
19064 jmc 24
    argument being used for dispatch at this level. }
25
  \item{\code{methods}:}{A named list of the methods (and method lists)
61433 ripley 26
    defined \emph{explicitly} for this argument.
39016 jmc 27
 The names are the names of classes, and the corresponding
28
  element defines the method or methods to be used if the corresponding
29
  argument has that class.  See the details below.}
30
  \item{\code{allMethods}:}{A named list,  contains
19064 jmc 31
    all the directly defined methods from the \code{methods} slot, plus
39016 jmc 32
    any inherited methods.  Ignored when methods tables are used for dispatch (see \link{Methods} }
17376 jmc 33
}}
19064 jmc 34
 
39016 jmc 35
\details{
36
  Suppose a function \code{f} has
37
  formal arguments \code{x} and \code{y}.  The methods list object for
38
  that function has the object \code{as.name("x")} as its
39
  \code{argument} slot.  An element of the methods named \code{"track"}
40
  is selected if the actual argument corresponding to \code{x} is an
41
  object of class \code{"track"}.  If there is such an element, it can
42
  generally be either a function or another methods list object.
19064 jmc 43
 
39016 jmc 44
  In the first case, the function defines the method to use for any call
45
  in which \code{x} is of class \code{"track"}.  In the second case, the
46
  new methods list object defines the available methods depending on
61433 ripley 47
  the remaining formal arguments, in this example, \code{y}.
39016 jmc 48
 
49
  Each method  corresponds conceptually to a \emph{signature};
50
  that is a named list of classes, with names corresponding to some or
51
  all of the formal arguments.  In the previous example, if selecting
52
  class \code{"track"} for \code{x}, finding that the selection was
53
  another methods list and then selecting class \code{"numeric"} for
54
  \code{y} would produce a method associated with the signature
55
  \code{x = "track", y = "numeric"}.
56
 
57
}
58
 
17376 jmc 59
\section{Extends}{
19064 jmc 60
Class \code{"OptionalMethods"}, directly.
17376 jmc 61
}
19064 jmc 62
\keyword{classes}
19123 hornik 63
\keyword{methods}