removeJavaConverter: Removes a converter for R and Java objects in the R-Java...

Description Usage Arguments Value Author(s) References See Also Examples

Description

This manipulates the internal list of object converters that control how objects are transferred from R to Java and from Java to R. It allows the R user to remove entries and control how objects are converted.

Usage

1
removeJavaConverter(id, fromJava=TRUE)

Arguments

id

the index or position of the converter to be removed in the specified converter list.

fromJava

logical value indicating which set of converters on which we are operating: from Java to R (TRUE) or from R to Java (FALSE). The latter is currently not implemented and awaits the next version which will use C++.

Value

Returns a integer identifying the position in the list in which the converter was located. This is a named vector and the name is the description of the converter. This allows one to ensure that you got the correct one.

Author(s)

Duncan Temple Lang

References

http://www.omegahat.org/RSJava

See Also

setJavaConverter setJavaConvertible the .convert argument of .Java and .JavaConstructor

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
   # remove the Constructor converter
## Not run: 
 removeJavaConverter(3)

   # add a converter -- userObject must be valid
 setJavaConverter(.RSJava.symbol("RealVariableConverter"),
                  matcher="AssignableFrom",
                  autoArray=TRUE,
                  description="Omegahat RealVariable to numeric vector",
                  userObject="RealVariable")

   # and remove it by specifying its description.
 removeJavaConverter("Omegahat RealVariable to numeric vector")

   # add the converter again
 cvt <- setJavaConverter(.RSJava.symbol("RealVariableConverter"),
                         matcher="AssignableFrom",
                         autoArray=TRUE,
                         description="Omegahat RealVariable to numeric vector",
                         userObject="RealVariable")

   # and remove it by specifying its position
   # which is given to us by the setJavaConverter call.
 removeJavaConverter(cvt$index)
 
## End(Not run)

SJava documentation built on Oct. 5, 2016, 4:17 a.m.