Mercurial > hg > octave-lojdl
changeset 15815:f28b3dcbaa9a
Add autoconversion between java.lang.Character class and Octave string class.
* libinterp/octave-value/ov-java.cc(box): Add test for java.lang.Character
class and convert to Octave string class.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 18 Dec 2012 11:39:24 -0800 |
parents | 1eee8d8c59fd |
children | 59b6c6aee042 |
files | libinterp/octave-value/ov-java.cc |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-java.cc +++ b/libinterp/octave-value/ov-java.cc @@ -967,6 +967,18 @@ } } + if (retval.is_undefined ()) + { + cls = jni_env->FindClass ("java/lang/Character"); + + if (jni_env->IsInstanceOf (jobj, cls)) + { + jmethodID m = jni_env->GetMethodID (cls, "charValue", "()C"); + retval = jni_env->CallCharMethod (jobj, m); + retval = retval.convert_to_str (false, true); + } + } + if (retval.is_undefined () && Vjava_matrix_autoconversion) { cls = find_octave_class (jni_env, "org/octave/Matrix");