Description Usage Arguments Details Methods See Also Examples
The $
operator for jobjRef
Java object references provides convenience access to object attributes and calling Java methods.
1 2 3 4 5 6 7 8 | ## S3 method for class 'jobjRef'
.DollarNames(x, pattern = "" )
## S3 method for class 'jarrayRef'
.DollarNames(x, pattern = "" )
## S3 method for class 'jrectRef'
.DollarNames(x, pattern = "" )
## S3 method for class 'jclassName'
.DollarNames(x, pattern = "" )
|
x |
object to complete |
pattern |
pattern |
rJava provides two levels of API: low-level JNI-API in the form of .jcall
function and high-level reflection API based on the $
operator. The former is very fast, but inflexible. The latter is a convenient way to use Java-like programming at the cost of performance. The reflection API is build around the $
operator on jobjRef-class
objects that allows to access Java attributes and call object methods.
$
returns either the value of the attribute or calls a method, depending on which name matches first.
$<-
assigns a value to the corresponding Java attribute.
names
and .DollarNames
returns all fields and methods associated with the object.
Method names are followed by (
or ()
depending on arity.
This use of names is mainly useful for code completion, it is not intended to be used programmatically.
This is just a convenience API. Internally all calls are mapped into .jcall
calls, therefore the calling conventions and returning objects use the same rules. For time-critical Java calls .jcall
should be used directly.
$
signature(x = "jobjRef")
: ...
$
signature(x = "jclassName")
: ...
$<-
signature(x = "jobjRef")
: ...
$<-
signature(x = "jclassName")
: ...
names
signature(x = "jobjRef")
: ...
names
signature(x = "jarrayRef")
: ...
names
signature(x = "jrectRef")
: ...
names
signature(x = "jclassName")
: ...
J
, .jcall
, .jnew
, jobjRef-class
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.