rJava (version 0.4-11)

jnull: Java null object reference

Description

.jnull returns a null reference of a specified class type. The resulting object is of the class jobjRef.

is.jnull is an extension of is.null that also returns TRUE if the supplied object it a null Java reference.

Usage

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

Arguments

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

Value

  • .jnull returns a Java object reference (jobjRef) of a null object having the specified object class.

    is.jnull returns TRUE if is.null(x) is TRUE or if x is a Java null reference.

code

null

Details

.jnull 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:

  • o
{public static void run(String a);} o{public static void run(Double n);}

See Also

.jcall, .jcast

Examples

Run this code
.jcall("java/lang/System","I","identityHashCode",.jnull())

Run the code above in your browser using DataCamp Workspace