EVOLUTION-MANAGER
Edit File: isSealedMethod.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Check for a Sealed Method or Class</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for isSealedMethod {methods}"><tr><td>isSealedMethod {methods}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Check for a Sealed Method or Class </h2> <h3>Description</h3> <p>These functions check for either a method or a class that has been <em>sealed</em> when it was defined, and which therefore cannot be re-defined. </p> <h3>Usage</h3> <pre> isSealedMethod(f, signature, fdef, where) isSealedClass(Class, where) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>f</code></td> <td> <p> The quoted name of the generic function. </p> </td></tr> <tr valign="top"><td><code>signature</code></td> <td> <p> The class names in the method's signature, as they would be supplied to <code><a href="setMethod.html">setMethod</a></code>. </p> </td></tr> <tr valign="top"><td><code>fdef</code></td> <td> <p> Optional, and usually omitted: the generic function definition for <code>f</code>. </p> </td></tr> <tr valign="top"><td><code>Class</code></td> <td> <p>The quoted name of the class.</p> </td></tr> <tr valign="top"><td><code>where</code></td> <td> <p>where to search for the method or class definition. By default, searches from the top environment of the call to <code>isSealedMethod</code> or <code>isSealedClass</code>, typically the global environment or the namespace of a package containing a call to one of the functions.</p> </td></tr> </table> <h3>Details</h3> <p>In the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> implementation of classes and methods, it is possible to seal the definition of either a class or a method. The basic classes (numeric and other types of vectors, matrix and array data) are sealed. So also are the methods for the primitive functions on those data types. The effect is that programmers cannot re-define the meaning of these basic data types and computations. More precisely, for primitive functions that depend on only one data argument, methods cannot be specified for basic classes. For functions (such as the arithmetic operators) that depend on two arguments, methods can be specified if <em>one</em> of those arguments is a basic class, but not if both are. </p> <p>Programmers can seal other class and method definitions by using the <code>sealed</code> argument to <code><a href="setClass.html">setClass</a></code> or <code><a href="setMethod.html">setMethod</a></code>. </p> <h3>Value</h3> <p>The functions return <code>FALSE</code> if the method or class is not sealed (including the case that it is not defined); <code>TRUE</code> if it is. </p> <h3>References</h3> <p>Chambers, John M. (2008) <em>Software for Data Analysis: Programming with R</em> Springer. (For the R version.) </p> <p>Chambers, John M. (1998) <em>Programming with Data</em> Springer (For the original S4 version.) </p> <h3>Examples</h3> <pre> ## these are both TRUE isSealedMethod("+", c("numeric", "character")) isSealedClass("matrix") setClass("track", slots = c(x="numeric", y="numeric")) ## but this is FALSE isSealedClass("track") ## and so is this isSealedClass("A Name for an undefined Class") ## and so are these, because only one of the two arguments is basic isSealedMethod("+", c("track", "numeric")) isSealedMethod("+", c("numeric", "track")) </pre> <hr /><div style="text-align: center;">[Package <em>methods</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>