selectSuperClasses {methods} | R Documentation |
Return superclasses of ClassDef
, possibly only non-virtual or
direct or simple ones.
These functions are designed to be fast, and consequently only work
with the contains
slot of the corresponding class definitions.
selectSuperClasses(Class, dropVirtual = FALSE, namesOnly = TRUE,
directOnly = TRUE, simpleOnly = directOnly,
where = topenv(parent.frame()))
.selectSuperClasses(ext, dropVirtual = FALSE, namesOnly = TRUE,
directOnly = TRUE, simpleOnly = directOnly)
Class |
name of the class or (more efficiently) the class
definition object (see |
dropVirtual |
logical indicating if only non-virtual superclasses should be returned. |
namesOnly |
logical indicating if only a vector names instead of a named list class-extensions should be returned. |
directOnly |
logical indicating if only a direct super classes should be returned. |
simpleOnly |
logical indicating if only simple class extensions should be returned. |
where |
(only used when |
ext |
for |
a character
vector (if namesOnly
is true, as per
default) or a list of class extensions (as the contains
slot in
the result of getClass
).
The typical user level function is selectSuperClasses()
which calls .selectSuperClasses()
; i.e., the latter should only
be used for efficiency reasons by experienced useRs.
is
, getClass
; further, the more technical
class classRepresentation
documentation.
setClass("Root")
setClass("Base", contains = "Root", representation(length = "integer"))
setClass("A", contains = "Base", representation(x = "numeric"))
setClass("B", contains = "Base", representation(y = "character"))
setClass("C", contains = c("A", "B"))
extends("C") #--> "C" "A" "B" "Base" "Root"
selectSuperClasses("C") # "A" "B"
selectSuperClasses("C", direct=FALSE) # "A" "B" "Base" "Root"
selectSuperClasses("C", dropVirt = TRUE, direct=FALSE)# ditto w/o "Root"