blob: a475c17c098564e54affe453a3c8de2b6ac34018 [file] [log] [blame]
% File src/library/methods/man/inheritedSlotNames.Rd
% Part of the R package, https://www.R-project.org
% Copyright 2009-2021 R Core Team
% Distributed under GPL 2 or later
\name{inheritedSlotNames}
\alias{inheritedSlotNames}
\title{Names of Slots Inherited From a Super Class}
\description{
For a class (or class definition, see \code{\link{getClass}} and
the description of class \code{\linkS4class{classRepresentation}}),
give the names which are inherited from \dQuote{above}, i.e., super
classes, rather than by this class' definition itself.
}
\usage{
inheritedSlotNames(Class, where = topenv(parent.frame()))
}
\arguments{
\item{Class}{character string or
\code{\linkS4class{classRepresentation}}, i.e., resulting from
\code{\link{getClass}}.}
\item{where}{environment, to be passed further to
\code{\link{isClass}} and \code{\link{getClass}}.}
}
\value{
character vector of slot names, or \code{\link{NULL}}.
}
\seealso{
\code{\link{slotNames}}, \code{\link{slot}}, \code{\link{setClass}}, etc.
}
\examples{
.srch <- search()
library(stats4)
inheritedSlotNames("mle")
if(require("Matrix", quietly = TRUE)) withAutoprint({
inheritedSlotNames("Matrix") # NULL
## whereas
inheritedSlotNames("sparseMatrix") # --> Dim & Dimnames
## i.e. inherited from "Matrix" class
cl <- getClass("dgCMatrix") # six slots, etc
inheritedSlotNames(cl) # *all* six slots are inherited
})
\dontrun{
% currently, don't do this when running all examples: classes remain
% cached anyway :
## detach package we've attached above:
for(n in rev(which(is.na(match(search(), .srch)))))
try( detach(pos = n) )
}% end{dontrun}
}
\keyword{classes}
\keyword{methods}