jfield | R Documentation |
.jfield
returns the value of the specified field on an object.
.jfield(o, sig = NULL, name, true.class = is.null(sig), convert = TRUE)
`.jfield<-`(o, name, value)
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 |
name |
name of the field to access |
true.class |
by default the class of the resulting object matches
the signature of the field. Setting this flag to |
convert |
when set to |
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 |
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.
.jfield
: contents of the field, .jfield<-
: modified object.
.jcall
## Not run:
.jfield("java/lang/Boolean",, "TYPE")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.