library(SJava) .JavaInit(list(classPath=paste(Sys.getenv("OMEGA_HOME"), "..", "..", sep = .Platform$file.sep))) .JavaConstructor("org.omegahat.DataStructures.Data.RealVariable", rnorm(10)) val <- setJavaConverter(.RSJava.symbol("RealVariableConverter"), matcher="AssignableFrom", autoArray=TRUE, description="Omegahat RealVariable to numeric vector", userObject="org.omegahat.DataStructures.Data.RealVariable" ) # now instantiate an object of class RealVariable # and the converter should take effect. # should produce a numeric vector of length 10 testRealVariable = function() { .JavaConstructor("org.omegahat.DataStructures.Data.RealVariable", rnorm(10), .convert = TRUE) } # Un-register the converter. # removeJavaConverter(val$index)