jnull {rJava}R Documentation

Creates a null object reference

Description

.jnull returns a null reference of a specified class type.

Usage

.jnull(class = "java/lang/Object")

Arguments

class fully qualified target class name in JNI notation (e.g. "java/lang/String").

Details

This function is necesary if null is to be passed as an argument of .jcall or .jnew, in order to be able to find the correct method/constructor.

Example: given the following method definitions of the class A:

Calling .jcall("A",,"run",NULL) is ambiguous, because it is unclear which method is to be used. Therefore rJava requires class information with each argument to .jcall. If we wanted to run the String-version, we could use .jcall("A",,"run",.jnull("java/lang/String")).

Value

Returns a Java object reference (jobjRef) of a null object having the specified object class.

See Also

.jcall, .jcast

Examples

## Not run: 
.jcall("java/lang/System","I","identityHashCode",.jnull())
## End(Not run)

[Package rJava version 0.4-3 Index]