selectSuperClasses          package:methods          R Documentation

_S_u_p_e_r _C_l_a_s_s_e_s (_o_f _S_p_e_c_i_f_i_c _K_i_n_d_s) _o_f _a _C_l_a_s_s

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     selectSuperClasses(Class, dropVirtual = FALSE, namesOnly = TRUE,
                        directOnly = TRUE, simpleOnly = directOnly,
                        where = topenv(parent.frame()))

     .selectSuperClasses(ext, dropVirtual = FALSE, namesOnly = TRUE,
                         directOnly = TRUE, simpleOnly = directOnly)

_A_r_g_u_m_e_n_t_s:

   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 'Class' is not a class definition)
          environment where the class definition of 'Class' is found.

     ext: for '.selectSuperClasses()' only, a 'list' of class
          extensions, typically 'getClassDef(..)@contains'.

_V_a_l_u_e:

     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').

_N_o_t_e:

     The typical user level function is 'selectSuperClasses()' which
     calls '.selectSuperClasses()'; i.e., the latter should only be
     used for efficiency reasons by experienced useRs.

_S_e_e _A_l_s_o:

     'is', 'getClass'; further, the more technical class
     'classRepresentation' documentation.

_E_x_a_m_p_l_e_s:

     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"

