getJavaMethods {Java}R Documentation

List the methods or constructors of a Java object.

Description

This is a convenient method for obtaining a list of all the methods a Java object provides.

Usage

getJavaMethods(what)
getJavaConstructors(what)

Arguments

what the (partially qualified) name of a Java class, or a reference to a Java object managed by the Omegahat evaluator. The latter contains the class name of the object.

Details

This is a simple use of .Java and the evaluator's methods getMethods and getConstructors. The getJavaMethods also adds the names to the resulting R list.

Value

A list of Java Method objects converted to their R equivalents. The names of the elements in the list are given by the name of the Java method. In the case of getJavaConstructors, no names are given since these have no explicit name. Each element describes the corresponding Java method in terms of

the exceptions it may throw.

Author(s)

Duncan Temple Lang

References

http://www.omegahat.org/RSJava

See Also

.Java .JavaConstructor .JNew

Examples

  v <- .JNew("util.Vector")
    # get all the methods
  getJavaMethods(v)
    # get all the add() methods
  getJavaMethods(v)[["add"]]

  getJavaConstructors("util.Vector")