warning
if its first letter is not captial. The
reason for this is to enforce a naming convention that names classes
with upper-case initial letters and methods with lower-case initial
letters (this is also the case in for instance Java).
What this function currently does is simply creating a constructor
function for the class.
Note: The constructor must be able to be called with no arguments,
i.e. use default values for all arguments or make sure you use
missing()
or similar!
For instance the following defintion is not correct:
setConstructorS3("Foo", function(x) extend(Object(), "Foo", x=x))
whereas this one is
setConstructorS3("Foo", function(x=NA) extend(Object(), "Foo", x=x))
## S3 method for class 'default':
setConstructorS3(name, definition, private=FALSE, protected=FALSE, static=FALSE, abstract=FALSE, trial=FALSE, deprecated=FALSE, envir=parent.frame(), enforceRCC=TRUE, ...)
missing()
or similar!TRUE
this class is defined to be static,
otherwise not. Currently this has no effect expect as an indicator.TRUE
this class is defined to be abstract,
otherwise not. Currently this has no effect expect as an indicator.TRUE
this class is defined to be private.TRUE
this class is defined to be protected.TRUE
this class is defined to be a trial class,
otherwise not. A trial class is a class that is introduced to be
tried out and it might be modified, replaced or even removed in a
TRUE
this class is defined to be deprecated,
otherwise not. Currently this has no effect expect as an indicator.TRUE
, only class names following the R Coding
Convention is accepted. If the RCC is violated an RccViolationException
is thrown.setMethodS3
.
For information about the R Coding Conventions, see
RccViolationException
.
For a thorough example of how to use this method see Object
.For a complete example see help(Object).
Run the code above in your browser using DataLab