\name{javaIs} \alias{javaIs} \title{Performs class comparisons for Java objects} \description{ Allows one to test if a Java object (in Omegahat) is an object of a particular class, or implements a particular Java interface. } \usage{ javaIs(obj, klass, instanceof=TRUE) } \arguments{ \item{obj}{the Java object whose class is being queried and compared} \item{klass}{the name of a Java class or the Class reference object with which the object \code{obj} is being compared.} \item{instanceof}{a logical value indicating whether the comparison should be done using the equality of classes or the Java \code{instanceof} semantics. The former tests whether the class of \code{obj} is the same as the class identified by \code{klass}. The latter identifies whether obj implements the Java interface class \code{klass}. (There is also the \emph{assignable from} semantics which may or may not be currently present).} } \details{ This calls the Omegahat evaluator's \code{is} method. } \value{ A logical value indicating whether the class of \code{obj} is related to \code{klass} in the specified comparison. This is \code{TRUE} or \code{FALSE}. } \references{\url{http://www.omegahat.org/RSJava}} \author{Duncan Temple Lang, John Chambers } \seealso{ \code{\link{.JNew}} \code{\link{.Java}} } \examples{ x <- .JNew("java.util.Vector") # TRUE javaIs(x, "java.util.Vector") javaIs(x, "java.util.List", TRUE) # FALSE javaIs(x, "java.util.Hashtable") } \keyword{programming} \keyword{interface}