jfield

0th

Percentile

Obtains the value of a field

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

Keywords
interface
Usage
.jfield(o, sig = NULL, name, true.class = is.null(sig), convert = TRUE)
.jfield<-(o, name, value)
Arguments
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.

Details

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.

Value

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

.jcall

• .jfield
• .jfield<-
Examples
# NOT RUN {
.jfield("java/lang/Boolean",, "TYPE")
# }

Documentation reproduced from package rJava, version 0.9-10, License: GPL-2

Community examples

Looks like there are no examples yet.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.21907958388328552, "perplexity": 3608.3671273079835}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-10/segments/1581875145529.37/warc/CC-MAIN-20200221111140-20200221141140-00334.warc.gz"}