SJava (version 0.98.0)

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

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

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.

References

http://www.omegahat.org/RSJava

See Also

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

Examples

Run this code
   # 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)

Run the code above in your browser using DataCamp Workspace