| Line 49... |
Line 49... |
| 49 |
from the other definition of the other class by calling
|
49 |
from the other definition of the other class by calling
|
| 50 |
\code{\link{getValidity}}: it should \emph{not} call
|
50 |
\code{\link{getValidity}}: it should \emph{not} call
|
| 51 |
\code{validObject}.
|
51 |
\code{validObject}.
|
| 52 |
}
|
52 |
}
|
| 53 |
\details{
|
53 |
\details{
|
| 54 |
Validity testing takes place ``bottom up'': first the validity of the
|
54 |
Validity testing takes place \dQuote{bottom up}: first the validity
|
| 55 |
object's slots, if any, is tested. Then for each of the classes that
|
55 |
of the object's slots, if any, is tested. Then for each of the
|
| 56 |
this class extends (the ``superclasses''), the explicit validity
|
56 |
classes that this class extends (the \dQuote{superclasses}), the
|
| 57 |
method of that class is called, if one exists. Finally, the validity
|
57 |
explicit validity method of that class is called, if one exists.
|
| 58 |
method of \code{object}'s class is called, if there is one.
|
58 |
Finally, the validity method of \code{object}'s class is called, if
|
| - |
|
59 |
there is one.
|
| 59 |
|
60 |
|
| 60 |
Testing generally stops at the first stage of finding an error, except
|
61 |
Testing generally stops at the first stage of finding an error, except
|
| 61 |
that all the slots will be examined even if a slot has failed its
|
62 |
that all the slots will be examined even if a slot has failed its
|
| 62 |
validity test.
|
63 |
validity test.
|
| 63 |
}
|
64 |
}
|
| Line 66... |
Line 67... |
| 66 |
Otherwise a vector of strings describing problems found, except that
|
67 |
Otherwise a vector of strings describing problems found, except that
|
| 67 |
if \code{test} is \code{FALSE}, validity failure generates an error,
|
68 |
if \code{test} is \code{FALSE}, validity failure generates an error,
|
| 68 |
with the corresponding strings in the error message.
|
69 |
with the corresponding strings in the error message.
|
| 69 |
}
|
70 |
}
|
| 70 |
\references{
|
71 |
\references{
|
| 71 |
The R package \code{methods} implements, with a few exceptions, the
|
72 |
The R package \pkg{methods} implements, with a few exceptions, the
|
| 72 |
programming interface for classes
|
73 |
programming interface for classes and methods in the book
|
| 73 |
and methods in the book \emph{Programming with Data} (John
|
74 |
\emph{Programming with Data} (John M. Chambers, Springer, 1998), in
|
| 74 |
M. Chambers, Springer, 1998), in particular sections 1.6, 2.7, 2.8,
|
- |
|
| 75 |
and chapters 7 and 8.
|
75 |
particular sections 1.6, 2.7, 2.8, and chapters 7 and 8.
|
| 76 |
|
76 |
|
| 77 |
While the programming interface for the methods package follows the reference,
|
77 |
While the programming interface for the \pkg{methods} package follows
|
| 78 |
the R software is an original implementation, so details in
|
78 |
the reference, the R software is an original implementation, so
|
| 79 |
the reference that reflect the S4 implementation may appear
|
79 |
details in the reference that reflect the S4 implementation may appear
|
| 80 |
differently in R. Also, there are extensions to the programming
|
80 |
differently in R. Also, there are extensions to the programming
|
| 81 |
interface developed more recently than the reference. For a
|
81 |
interface developed more recently than the reference. For a
|
| 82 |
discussion of details and ongoing development, see the web page
|
82 |
discussion of details and ongoing development, see the web page
|
| 83 |
\url{http://developer.r-project.org/methodsPackage.html} and the
|
83 |
\url{http://developer.r-project.org/methodsPackage.html} and the
|
| 84 |
pointers from that page.
|
84 |
pointers from that page.
|