Cast a Java object to another class
.jcast returns a Java object reference cast to another Java class.
.jcast(obj, new.class = "java/lang/Object", check = FALSE, convert.array = FALSE)
obj |
a Java object reference |
new.class |
fully qualified class name in JNI notation
(e.g. |
check |
logical. If |
convert.array |
logical. If |
The default values for the arguments check and convert.array
is FALSE in order to guarantee backwards compatibility,
but it is recommended to set the arguments to TRUE
Returns a Java object reference (jobjRef) to the object
obj, changing the object class.
## Not run:
v <- .jnew("java/util/Vector")
.jcall("java/lang/System","I","identityHashCode",.jcast(v, "java/lang/Object"))
## End(Not run)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.