jfield                 package:rJava                 R Documentation

_O_b_t_a_i_n_s _t_h_e _v_a_l_u_e _o_f _a _f_i_e_l_d

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

     '.jfield' returns the value of the specified field on an object.

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

     .jfield(o, sig = NULL, name, true.class = is.null(sig), convert = TRUE)
     `.jfield<-`(o, name, value)

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

       o: Class name or object (Java reference) whose field is to be
          accessed. Static fields are supported both by specifying the
          class name or using an instance.

     sig: signature (JNI type) of the field. If set to 'NULL' rJava
          attempts to determine the signature using reflection. For
          efficiency it is recommended to specify the signature,
          because the reflection lookup is quite expensive.

    name: name of the field to access

true.class: by default the class of the resulting object matches the
          siganture of the field. Setting this flag to 'TRUE' causes
          '.jfield' to use true class name of the resulting object
          instead. (this flag has no effect on scalar fields)

 convert: when set to 'TRUE' all references are converted to native
          types (where possible). Otherwise Java references are
          returned directly.

   value: value to assign into the field. The field signature is
          determined from the value in the same way that parameter
          signatures are determined in '.jcall' - be sure to cast the
          value as necessary, no automatic conversion is done.

_D_e_t_a_i_l_s:

     The detection of a field signature in '.jfield' using reflection
     is considerably expensive (more than 3 additional method calls
     have to be performed), therefore it is recommended for
     time-critical code to specify the field signature beforehand.

     NOTE: The sequence of arguments in '.jfield' has been changed
     since rJava 0.5 to be more consistent and match the sequence in
     '.jcall'. Also '.jsimplify' is no longer needed as primitive types
     are obtained directly.

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

     '.jfield': contents of the field, '.jfield<-': modified object.

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

     '.jcall'

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

     ## Not run: 
     .jfield("java/lang/Boolean",, "TYPE")
     ## End(Not run)

