Description Usage Arguments Value Note Author(s) References See Also Examples
Register a C routine which converts a Java object to an R object. This
occurs when a value is returned from a Java method (or constructor)
call via .Java
or .JavaConstructor
.
1 2 | setJavaConverter(handler, matcher=-1, autoArray=TRUE, description="",
userObject=NULL, register = TRUE)
|
handler |
The name of a C routine that performs the conversion
from the Java object to the R object. This is given the Java
object, the class of that object, the JNI environment and the
element in the converter object is to be called when the the
|
matcher |
The name of a routine that is used to determine
whether this converter can handle a specific object. This can also
be specified as an element of the vector |
autoArray |
A logical value indicating whether this converter routine can be called element-wise for an array of the class type it matches (TRUE) , or whether it wishes to defer the handling of such an array to another converter or deal with it all in one step. |
description |
A string that describes the action of the converter
(e.g. the type of source Java class and target R object on which it
operates). This is stored with the internal converter and
accessible to users via the
|
userObject |
If the |
register |
a logical value indicating whether this call should
also notify Java that the specified class (i.e. that given in
|
This returns the expanded named of the class used to parameterize the matching function and the identifier for the matching function itself.
match |
the value passed to the C routine identifying the matching
function. This is either an element from |
class |
The name of the class used to parameterize the matching
function, if the latter is one of the built-in routines named in |
index |
the position in the list into which this converter was added.
This is useful if we want to remove the converter at a later stage via
|
description |
the description argument passed to this function call.
As with the |
In the near future, we will re-establish the mechanism for specifying R functions or closure instances for the handler and matcher. This has become more complicated than intended and will probably be restricted to work only for C routines. All of the cases have not been tested entirely.
Duncan Temple Lang
http://www.omegahat.org, http://www.javasoft.com
getJavaConverterDescriptions
getNumJavaConverters
setJavaConvertible
1 2 3 4 5 6 7 8 | ## Not run:
setJavaConverter(.RSJava.symbol("RealVariableConverter"),
matcher="AssignableFrom",
autoArray=TRUE,
description="Omegahat RealVariable to numeric vector",
userObject="RealVariable")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.