Stage-class: Stage: Abstract Step in a Pipeline

Description Constructors Accessors Author(s) See Also Examples

Description

A Stage object represents a role to be played by protocols in a pipeline. In other words, a stage is an abstract step that transforms one data type into another. The transformation may be implemented in a number of ways, each corresponding to a protocol. Users normally do not have to interact with this object. Developers can define new types of stages with setStage.

Constructors

Stage(role): Creates a stage object given the role name.

Accessors

role(object): Gets the name of the role represented by this stage.

displayName(object): Gets the name for displaying this stage in a user interface.

inType(object): Gets the class of data that protocols of this stage accept as input.

outType(object): Gets the class of data that protocols of this stage yield as output.

defaultMethod(object): Gets the name of the default method associated with the role of this stage. If not explicitly set, this becomes the first protocol registered for the stage.

defaultMethod(object) <- value: Sets the name of the default method associated with the role of this stage.

methodNames(object, where = topenv(parent.frame())): Gets the names of the methods for this stage, looking in where for the protocol classes.

Author(s)

Michael Lawrence

See Also

setStage for defining new types of stages

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
setStage("average", "Average Numbers", intype = "numeric")
setProtocol("mean", fun = mean, parent = "average")
setProtocol("median", fun = median, parent = "average")

stage <- Stage("average")
stage

defaultMethod(stage)
defaultMethod(stage) <- "median"
defaultMethod(stage)

commandr documentation built on May 2, 2019, 5:09 a.m.