R: Classes to Represent Method Definitions

MethodDefinition-class {methods} | R Documentation

## Classes to Represent Method Definitions

### Description

These classes extend the basic class `"function"` when functions are to be stored and used as method definitions.

### Details

Method definition objects are functions with additional information defining how the function is being used as a method. The `target` slot is the class signature for which the method will be dispatched, and the `defined` slot the signature for which the method was originally specified (that is, the one that appeared in some call to `setMethod`).

### Objects from the Class

The action of setting a method by a call to `setMethod` creates an object of this class. It's unwise to create them directly.

The class `"SealedMethodDefinition"` is created by a call to `setMethod` with argument `sealed = TRUE`. It has the same representation as `"MethodDefinition"`.

### Slots

`.Data`:

  Object of class `"function"`; the data part of the definition.

`target`:

  Object of class `"signature"`; the signature for which the method was wanted.

`defined`:

  Object of class `"signature"`; the signature for which a method was found. If the method was inherited, this will not be identical to `target`.

`generic`:

  Object of class `"character"`; the function for which the method was created.

### Extends

Class `"function"`, from data part.
Class `"PossibleMethod"`, directly.
Class `"OptionalMethods"`, by class `"function"`.

### See Also

class `MethodsList` for the objects defining sets of methods associated with a particular generic function. The individual method definitions stored in these objects are from class `MethodDefinition`, or an extension. Class `MethodWithNext` for an extension used by `callNextMethod`.

[Package methods version 3.1.2 Index]