positiveIndex-class      package:externalVector      R Documentation

_C_l_a_s_s "_p_o_s_i_t_i_v_e_I_n_d_e_x", _i_n_d_e_x _c_l_a_s_s _r_e_p_r_e_s_e_n_t_i_n_g _a _s_e_q_u_e_n_c_e _o_f
_n_o_n-_n_e_g_a_t_i_v_e _i_n_t_e_g_e_r_s

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

     This represents a subscript of arbitrary non-negative integers.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the form 'new("positiveIndex",
     val)'. If 'val' is missing, the result is an object of class
     '"positiveIndex"' of length '0'. Otherwise, it is coerced to an
     integer and an object of class  '"positiveIndex"' is created which
     has the same '.Data' slot as 'val'. The 'rangeIndex' and 'noNA'
     slots are calculated by the initialization code.

_S_l_o_t_s:


     '._D_a_t_a': Object of class '"integer"', the actual index values. 

     '_r_a_n_g_e_I_n_d_e_x': Object of class '"integer"' of length '2', same as
          'range(.Data)'. 

     '_n_o_N_A': Object of class '"logical"' of length 1, same as
          '!any(is.na(.Data))'. 

_E_x_t_e_n_d_s:

     Class '"integer"', directly. Class '"vectorIndex"', directly.

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

     Signature components for the methods are:

       x        The class "allIndex"
       scalar   Length one positive "integer"
       i        The class "ANY"
       value    The class "ANY"
       .Object  The class "allIndex"


     '_x+_s_c_a_l_a_r' Add 'scalar' to 'x'. Result is 'x' with 'x@.Data'
          replaced by 'x@.Data+scalar'. 

     '_s_c_a_l_a_r+_x' Add 'scalar' to 'x'. Result is 'x' with 'x@.Data'
          replaced by 'x@.Data+scalar'. 

     '_x*_s_c_a_l_a_r' Multiply 'x' by 'scalar'. Result is 'x' with 'x@.Data'
          replaced by 'x@.Data*scalar'. 

     '_s_c_a_l_a_r*_x' Multiply 'x' by 'scalar'. Result is 'x' with 'x@.Data'
          replaced by 'x@.Data*scalar'. 

     _d_i_m(_x) <- _v_a_l_u_e Set a dimension on 'x'. If value is of length 2,
          this may create a "matrixIndex". 

     '_x[_i]' Subset x. If length of 'i' is '0', the result is an object
          of class '"noneIndex"'. Otherwise, the result is an object of
          class '"sliceIndex"' or of class '"positiveIndex"'. 

     '_x[]' Subset x with the subscript missing. Result is x. 

     '_a_l_l_N_A(_x)' Are all elements of 'x' 'NA'? Result is
          'all(is.na(x@.Data))'. 

     '_a_n_y_N_A(_x)' Is any element of 'x' 'NA'? Result is
          'any(is.na(x@.Data))'. 

     '_a_s._i_n_t_e_g_e_r(_x)' Convert 'x' to an R subscript - adds 1 to each
          element of 'x@.Data'. 

     '_i_n_i_t_i_a_l_i_z_e(._O_b_j_e_c_t, ._D_a_t_a)' Initialize '.Object'. 

