SJava (version 0.98.0)

setJavaConvertible: Register a Java class as being convertible to an R object

Description

When a value is to be returned from Java to R, the Omegahat evaluator examines a table to determine if an object of that type can be converted to R. This function manipulates that table and allows one to control for what types of objects conversion is attempted.

This is not used currently. The Java objects are returned directly and the user-level converters determine whether the object is `convertible'.

Usage

setJavaConvertible(klass, ok=TRUE, matching=0)

Arguments

klass
The name of a Java class or interface which is to be added or removed from the set of known convertible classes. This can be a partially qualified class name that is resolved by the Omegahat evaluator.
ok
logical value indicating whether objects of class klass are to be considered convertible or not by the Omegahat sub-system.
matching
an integer value from the set 0, 1 and 2. These values indicate how comparisons between the registerd class and the object to be converted are performed.
0
An exact match, meaning that the class of the object must be the same as the class being registered as convertible.

1
the target object must be an instance of the class being registered, meaning that it implements this Java interface or is an instance of a class that is derived from the registered one.

2
the target object must be compatible with the registered class in the sense of isAssignableFrom method between two classes.

These constants are defined in the Java interface ConvertibleClassifierInt.

Value

NULL corresponding to a call to a Java method returning void.

Details

Simply calls setJavaConvertible in the Omegahat evaluator which passes the request on to the ConverterClassifierInt object employed by that evaluator.

References

http://www.omegahat.org/RSJava

See Also

setJavaConverter getJavaConverterDescriptions getNumJavaConverters