.JavaClass
Java Classes

Description

Access Java classes.

Usage

.JavaClass(object, mustFind=FALSE)
.JavaClassObject(javaClass)

Arguments

object any object, including a Java object reference.
mustFind A logical. If TRUE, and a Java class cannot be determined, an error is generated.
javaClass a string specifying a full Java classname, such as "Ljava/lang/Math;". This class can also be specified as "java/lang/Math" or "java.lang.Math".

Details

If .JavaClass is called with object a Java reference object, it returns its associated Java class name. If it is called with object as any other object, it tries to find the Java class that would be produced on converting the object to a Java object. If object is an atomic vector, it assumes that it should be a Java scalar if it has length of one, otherwise assumes it should be a Java array.
Value
.JavaClassreturns a string naming a Java class, of the form "Ljava/lang/String;". If a class cannot be determined, and mustFind is FALSE, returns NULL.
.JavaClassObjectreturns a Java reference object to the Java class object for the specified class.
See Also
.JavaCall, .JavaRef, .JavaFieldGet, .JavaArray
Examples
.JavaClass(123L)  ## "I"
.JavaClass(1:3)   ## "[I"

.JavaClass(.JavaRef("abc")) ## "Ljava/lang/String;"

.JavaClassObject("I") .JavaClassObject("[I")

Package terrJava version 6.0.0-69
Package Index