selectSuperClasses {methods}
Description
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.
Usage
selectSuperClasses(Class, dropVirtual = FALSE, namesOnly = TRUE,
directOnly = TRUE, simpleOnly = directOnly,
where = topenv(parent.frame()))
.selectSuperClasses(ext, dropVirtual = FALSE, namesOnly = TRUE,
directOnly = TRUE, simpleOnly = directOnly)
Arguments
- Class
- name of the class or (more efficiently) the class definition object (see
getClass). - 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
Classis not a class definition) environment where the class definition ofClassis found. - ext
- for
.selectSuperClasses()only, alistof class extensions, typicallygetClassDef(..)@contains.
Values
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).
Note
The typical user level function is selectSuperClasses() which calls .selectSuperClasses(); i.e., the latter should only be used for efficiency reasons by experienced useRs.
Examples
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"
Documentation reproduced from R 3.0.1. License: GPL-2.
