| javaIs {Java} | R Documentation |
Allows one to test if a Java object (in Omegahat) is an object of a particular class, or implements a particular Java interface.
javaIs(obj, klass, instanceof=T)
obj |
the Java object whose class is being queried and compared |
klass |
the name of a Java class or the Class reference object
with which the object obj is being compared. |
instanceof |
a logical value indicating whether the comparison
should be done using the
equality of classes or the Java instanceof semantics.
The former tests whether the class of obj
is the same as the class identified by klass.
The latter identifies whether obj implements
the Java interface class klass.
(There is also the textit{assignable from}
semantics which may or may not be currently present.)
|
This calls the Omegahat evaluator's
is method.
a logical value indicating whether
the class of obj
is related to
klass in the specified comparison.
This is TRUE or FALSE.
Duncan Temple Lang, John Chambers
http://www.omegahat.org/RSJava
x <- .JNew("java.util.Vector")
# TRUE
javaIs(x, "java.util.Vector")
javaIs(x, "java.util.List", T)
# FALSE
javaIs(x, "java.util.Hashtable")