\name{OmegahatReference} \alias{$.OmegahatReference} \alias{[[.OmegahatReference} \alias{[[<-.OmegahatReference} \alias{print.OmegahatReference} \title{Accessing Java classes, methods and field} \description{ The \code{$} methods allow one to invoke Java methods in the form % \code{jobj$methodName(arg1,arg2,....)} % The \code{[[} methods allow access to class fields as % \code{jobj[["fieldName"]]} % \code{jobj[["fieldName"]] <- value} } \usage{ \method{$}{OmegahatReference}(obj, name) \method{[[}{OmegahatReference}(x, name, ...) \method{[[}{OmegahatReference}(x, name, ...) <- value \method{print}{OmegahatReference}(x, ...) } \arguments{ \item{obj}{A reference to the Java object.} \item{x}{A reference to the Java object.} \item{name}{The name of the Java method or field being accessed.} \item{value}{The value to be assigned to the field.} \item{...}{Additional arguments; ignored for \code{print}.} } \details{ The \code{$} method is equivalent to \code{.Java(obj, name,)} The \code{[[} method is equivalent to \code{.Java(NULL, "getField", name, x)}. The \code{[[<-} method is equivalent to \code{.Java(NULL, "setField", name, x, value)}. } \value{ The return value of \code{$} is a function which remembers the arguments to this function call and, when called, results in a call to \code{\link{.Java}} using those arguments. The return value of \code{[[} is the field value. \code{print} is called for its side effect, i.e., providing a compact represntation of the object. } \references{\url{http://www.omegahat.org/RSJava}} \author{Duncan Temple Lang} \seealso{ \code{\link{.Java}} } \examples{ p <- .Java("System", "getProperties", .convert=FALSE) p$getProperty("java.class.path") } \keyword{programming} \keyword{interface}