Sometimes a result of a method is by definition of the class
java.lang.Object
, but the acutal referenced object may be an
array. In that case the method returns a Java object reference instead
of an array reference. In order to obtain an array reference, it is
necessary to cast such an object to an array reference - this is done
using the above .jcastToArray
function. The input is an object reference that points to an array. Ususally the
signature should be left at NULL
such that it is determined
from the object's class. This is also a check, because if the object's
class is not an array, then the functions fails either with an error
(when quiet=FALSE
) or by returing the original object (when
quiet=TRUE
). If the signature is set to anything else, it is
not verified and the array reference is always created, even if it may
be invalid and unusable.
For convenience .jcastToArray
also accepts non-references in
which case it simply calls .jarray
, ignoring all other
parameters.