ListLike-class            package:IRanges            R Documentation

_L_i_s_t_L_i_k_e _o_b_j_e_c_t_s

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

     The ListLike class is just an interface i.e. a virtual class with
     no slots. ListLike subclasses (i.e. classes that contain the
     ListLike class) must define the following minimal set of
     functions/operators: 'length', '"[["' and 'names'. Then, instances
     of these subclasses can be considered to have the shape of a list,
     and the methods described below apply to them.

     Some direct subclasses of the ListLike class are: Views,
     MaskCollection, XStringSet (defined in the Biostrings package),
     etc...

_M_e_t_h_o_d_s:

     In the code snippets below, 'x' and 'X' are ListLike objects.


      'x$name': Similar to 'x[[name]]', but 'name' is taken literally
          as an element name.

      'lapply(X, FUN, ...)': Like the standard 'lapply' function
          defined in the base package, the 'lapply' method for ListLike
          objects returns a list of the same length as 'X', each
          element of which is the result of applying 'FUN' to the
          corresponding element of 'X'.

      'sapply(X, FUN, ..., simplify=TRUE, USE.NAMES=TRUE)': Like the
          standard 'sapply' function defined in the base package, the
          'sapply' method for ListLike objects is a user-friendly
          version of 'lapply' by default returning a vector or matrix
          if appropriate.

      'as.list(x, ...)': Turns 'x' into a standard list.

      'isEmpty(x)': Here 'x' can be an atomic, list or ListLike object,
          or any object for which an 'isEmpty' method is defined. If
          'x' is atomic, returns 'length(x) == 0L'. If 'x' is a list or
          ListLike object, then it works elementwise and is defined
          recursively by 'sapply(x, function(xx) all(isEmpty(xx)))'.


_A_u_t_h_o_r(_s):

     H. Pages

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

     'lapply', 'sapply', 'as.list'.

     Some direct subclasses of the ListLike class: TypedList-class,
     Views-class, MaskCollection-class, XStringSet-class.

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

       showClass("ListLike")  # shows (some of) the known subclasses

