Comparing two Java objects is performed by calling equals
method of one of the objects and passing the other object as its
argument. This allows Java objects to define the `equality' in
object-dependent way. In addition, .jequals
allows the comparison of Java object to
other scalar R objects. This is done by creating a temporary Java
object that corresponds to the R object and using it for a call to the
equals
method. If such conversion is not possible a warning is
produced and the result it FALSE
. The automatic conversion
will be avoided if strict
parameter is set to TRUE
.
NULL
values in a
or b
are replaced by Java
null
-references and thus .jequals(NULL,NULL)
is TRUE
.
If neither a
and b
are Java objects (with the exception
of both being NULL
) then the result is identical to that of
all.equal(a,b)
.
Neither comparison operators nor .jequals
supports vectors and
returns FALSE
in that case. A warning is also issued unless
strict comparison was requested.