I use rJava package to create a wrapper for java implementation in R. Currently, I want to create a wrapper for only two methods (put and search) of GeneralizedSuffixTree class present in the mentioned java implementation.
The signature of search() method of GeneralizedSuffixTree class is
public Collection<Integer> search(String word){
return search(word, -1);
}
Correspondingly, I have created a following wrapper method:
callsearch <- function(key){
hook2 <- .jnew("GeneralizedSuffixTree") # instance of class
out <- .jcall(hook2,"Ljava/lang/Object","search",as.character(key), evalArray= FALSE, evalString = FALSE)
return(out)
}
So, whenever I call the search method from rstudio with callsearch("abcdea"), I used to get following error
Error in .jcall(hook2, "Ljava/lang/Object", "search", as.character(key), :
method search with signature (Ljava/lang/String;)Ljava/lang/Object not found
I think I am doing some wrong casting for Integer collection in R. May I know where I am doing wrong?
Complete under-development wrapper package is present at the link
Collection<Integer>intoObjectin your java code?