jfloat                 package:rJava                 R Documentation

_W_r_a_p _n_u_m_e_r_i_c _v_e_c_t_o_r _a_s _f_l_a_t _J_a_v_a _p_a_r_a_m_e_t_e_r

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

     '.jfloat' marks a numberic vector as an object that can be used as
     parameter to Java calls that require 'float' parameters.
     Similarly, '.jlong' marks a numeric vector as 'long' parameter.

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

     .jfloat(x)
     .jlong(x)
     .jbyte(x)
     .jchar(x)
     .jshort(x)

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

       x: numeric vector

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

     R has no native 'float' or 'long' type. Numeric vectors are stored
     as 'double's, hence there is no native way to pass float numbers
     to Java methods. The '.jfloat' call marks a numeric vector as
     having the Java type 'float' by wrapping it in the 'jfloat' class.
     The class is still a subclass of 'numeric', therefore all regular
     R operations are unaffected by this.

     Similarly, '.jlong' is used to mark a numeric vector as a
     parameter of the 'long' Java type. Please note that in general R
     has no native type that will hold a 'long' value, so conversion
     between Java's 'long' type and R's numeric is potentially lossy.

     '.jbyte' is used when a scalar byte is to be passed ot Java. Note
     that byte arrays are natively passed as RAW vectors, not as
     '.jbyte' arrays.

     'jchar' is strictly experimental and may be based on 'character'
     vectors in the future.

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

     Returns a numeric vector of the class 'jfloat', 'jlong', 'jbyte',
     'jshort' or 'jchar' that can be used as parameter to Java calls
     that require 'float', 'long', 'byte', 'short' or 'char' parameters
     respectively.

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

     '.jcall', 'jfloat-class'

