\HeaderA{selectSuperClasses}{Super Classes (of Specific Kinds) of a Class}{selectSuperClasses}
\aliasA{.selectSuperClasses}{selectSuperClasses}{.selectSuperClasses}
\keyword{programming}{selectSuperClasses}
\keyword{classes}{selectSuperClasses}
\begin{Description}\relax
Return superclasses of \code{ClassDef}, possibly only non-virtual or
direct or simple ones.

These functions are designed to be fast, and consequently only work
with the \code{contains} slot of the corresponding class definitions.
\end{Description}
\begin{Usage}
\begin{verbatim}
selectSuperClasses(Class, dropVirtual = FALSE, namesOnly = TRUE,
                   directOnly = TRUE, simpleOnly = directOnly,
                   where = topenv(parent.frame()))

.selectSuperClasses(ext, dropVirtual = FALSE, namesOnly = TRUE,
                    directOnly = TRUE, simpleOnly = directOnly)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{Class}] name of the class or (more efficiently) the class
definition object (see \code{\LinkA{getClass}{getClass}}).
\item[\code{dropVirtual}] logical indicating if only non-virtual superclasses
should be returned.
\item[\code{namesOnly}] logical indicating if only a vector names instead of
a named list class-extensions should be returned.
\item[\code{directOnly}] logical indicating if only a \emph{direct} super
classes should be returned.
\item[\code{simpleOnly}] logical indicating if only simple class extensions
should be returned.
\item[\code{where}] (only used when \code{Class} is not a class definition)
environment where the class definition of \code{Class} is found.
\item[\code{ext}] for \code{.selectSuperClasses()} only, a \code{\LinkA{list}{list}}
of class extensions, typically \code{\LinkA{getClassDef}{getClassDef}(..)@contains}.
\end{ldescription}
\end{Arguments}
\begin{Value}
a \code{\LinkA{character}{character}} vector (if \code{namesOnly} is true, as per
default) or a list of class extensions (as the \code{contains} slot in
the result of \code{\LinkA{getClass}{getClass}}).
\end{Value}
\begin{Note}\relax
The typical user level function is \code{selectSuperClasses()}
which calls \code{.selectSuperClasses()}; i.e., the latter should only
be used for efficiency reasons by experienced useRs.
\end{Note}
\begin{SeeAlso}\relax
\code{\LinkA{is}{is}}, \code{\LinkA{getClass}{getClass}}; further, the more technical
class \code{\LinkA{classRepresentation}{classRepresentation.Rdash.class}} documentation.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
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"
\end{ExampleCode}
\end{Examples}

