Mercurial > hg > octave-nkf
comparison libinterp/octave-value/ov-java.cc @ 17787:175b392e91fe
Use GNU style coding conventions for code in libinterp/
* libinterp/corefcn/Cell.h, libinterp/corefcn/__contourc__.cc,
libinterp/corefcn/__dispatch__.cc, libinterp/corefcn/__lin_interpn__.cc,
libinterp/corefcn/__pchip_deriv__.cc, libinterp/corefcn/__qp__.cc,
libinterp/corefcn/balance.cc, libinterp/corefcn/besselj.cc,
libinterp/corefcn/betainc.cc, libinterp/corefcn/bitfcns.cc,
libinterp/corefcn/bsxfun.cc, libinterp/corefcn/c-file-ptr-stream.cc,
libinterp/corefcn/c-file-ptr-stream.h, libinterp/corefcn/cellfun.cc,
libinterp/corefcn/colloc.cc, libinterp/corefcn/comment-list.h,
libinterp/corefcn/conv2.cc, libinterp/corefcn/daspk.cc,
libinterp/corefcn/dasrt.cc, libinterp/corefcn/dassl.cc,
libinterp/corefcn/data.cc, libinterp/corefcn/debug.cc,
libinterp/corefcn/defaults.cc, libinterp/corefcn/defaults.in.h,
libinterp/corefcn/defun-int.h, libinterp/corefcn/defun.cc,
libinterp/corefcn/det.cc, libinterp/corefcn/dirfns.cc,
libinterp/corefcn/display.cc, libinterp/corefcn/dlmread.cc,
libinterp/corefcn/dot.cc, libinterp/corefcn/dynamic-ld.cc,
libinterp/corefcn/dynamic-ld.h, libinterp/corefcn/eig.cc,
libinterp/corefcn/ellipj.cc, libinterp/corefcn/error.cc,
libinterp/corefcn/error.h, libinterp/corefcn/event-queue.h,
libinterp/corefcn/fft.cc, libinterp/corefcn/fft2.cc, libinterp/corefcn/fftn.cc,
libinterp/corefcn/file-io.cc, libinterp/corefcn/filter.cc,
libinterp/corefcn/find.cc, libinterp/corefcn/gammainc.cc,
libinterp/corefcn/gcd.cc, libinterp/corefcn/getgrent.cc,
libinterp/corefcn/getpwent.cc, libinterp/corefcn/getrusage.cc,
libinterp/corefcn/givens.cc, libinterp/corefcn/gl-render.cc,
libinterp/corefcn/gl2ps-renderer.cc, libinterp/corefcn/gl2ps-renderer.h,
libinterp/corefcn/graphics.cc, libinterp/corefcn/graphics.in.h,
libinterp/corefcn/gripes.cc, libinterp/corefcn/gripes.h,
libinterp/corefcn/help.cc, libinterp/corefcn/hess.cc,
libinterp/corefcn/hex2num.cc, libinterp/corefcn/input.cc,
libinterp/corefcn/input.h, libinterp/corefcn/inv.cc,
libinterp/corefcn/jit-ir.h, libinterp/corefcn/jit-typeinfo.cc,
libinterp/corefcn/jit-typeinfo.h, libinterp/corefcn/jit-util.h,
libinterp/corefcn/kron.cc, libinterp/corefcn/load-path.cc,
libinterp/corefcn/load-path.h, libinterp/corefcn/load-save.cc,
libinterp/corefcn/load-save.h, libinterp/corefcn/lookup.cc,
libinterp/corefcn/ls-ascii-helper.cc, libinterp/corefcn/ls-hdf5.cc,
libinterp/corefcn/ls-hdf5.h, libinterp/corefcn/ls-mat-ascii.cc,
libinterp/corefcn/ls-mat-ascii.h, libinterp/corefcn/ls-mat4.cc,
libinterp/corefcn/ls-mat5.cc, libinterp/corefcn/ls-mat5.h,
libinterp/corefcn/ls-oct-ascii.cc, libinterp/corefcn/lsode.cc,
libinterp/corefcn/lu.cc, libinterp/corefcn/luinc.cc,
libinterp/corefcn/mappers.cc, libinterp/corefcn/matrix_type.cc,
libinterp/corefcn/max.cc, libinterp/corefcn/md5sum.cc,
libinterp/corefcn/mex.cc, libinterp/corefcn/mexproto.h,
libinterp/corefcn/mgorth.cc, libinterp/corefcn/mxarray.in.h,
libinterp/corefcn/nproc.cc, libinterp/corefcn/oct-hist.cc,
libinterp/corefcn/oct-lvalue.h, libinterp/corefcn/oct-map.cc,
libinterp/corefcn/oct-map.h, libinterp/corefcn/oct-obj.h,
libinterp/corefcn/oct-prcstrm.h, libinterp/corefcn/oct-stdstrm.h,
libinterp/corefcn/oct-stream.cc, libinterp/corefcn/oct-stream.h,
libinterp/corefcn/octave-link.cc, libinterp/corefcn/octave-link.h,
libinterp/corefcn/pager.cc, libinterp/corefcn/pinv.cc,
libinterp/corefcn/pr-output.cc, libinterp/corefcn/procstream.h,
libinterp/corefcn/profiler.cc, libinterp/corefcn/pt-jit.cc,
libinterp/corefcn/pt-jit.h, libinterp/corefcn/quad.cc,
libinterp/corefcn/quadcc.cc, libinterp/corefcn/qz.cc,
libinterp/corefcn/rand.cc, libinterp/corefcn/rcond.cc,
libinterp/corefcn/regexp.cc, libinterp/corefcn/schur.cc,
libinterp/corefcn/sighandlers.cc, libinterp/corefcn/sighandlers.h,
libinterp/corefcn/sparse-xdiv.cc, libinterp/corefcn/sparse-xdiv.h,
libinterp/corefcn/sparse-xpow.cc, libinterp/corefcn/sparse.cc,
libinterp/corefcn/spparms.cc, libinterp/corefcn/sqrtm.cc,
libinterp/corefcn/str2double.cc, libinterp/corefcn/strfind.cc,
libinterp/corefcn/strfns.cc, libinterp/corefcn/sub2ind.cc,
libinterp/corefcn/svd.cc, libinterp/corefcn/syl.cc,
libinterp/corefcn/symtab.cc, libinterp/corefcn/symtab.h,
libinterp/corefcn/syscalls.cc, libinterp/corefcn/sysdep.cc,
libinterp/corefcn/sysdep.h, libinterp/corefcn/time.cc,
libinterp/corefcn/toplev.cc, libinterp/corefcn/toplev.h,
libinterp/corefcn/tril.cc, libinterp/corefcn/txt-eng-ft.cc,
libinterp/corefcn/txt-eng-ft.h, libinterp/corefcn/txt-eng.h,
libinterp/corefcn/typecast.cc, libinterp/corefcn/urlwrite.cc,
libinterp/corefcn/utils.cc, libinterp/corefcn/variables.cc,
libinterp/corefcn/variables.h, libinterp/corefcn/xdiv.cc,
libinterp/corefcn/xdiv.h, libinterp/corefcn/xnorm.h, libinterp/corefcn/xpow.cc,
libinterp/corefcn/xpow.h, libinterp/corefcn/zfstream.cc,
libinterp/corefcn/zfstream.h, libinterp/dldfcn/__delaunayn__.cc,
libinterp/dldfcn/__dsearchn__.cc, libinterp/dldfcn/__eigs__.cc,
libinterp/dldfcn/__fltk_uigetfile__.cc, libinterp/dldfcn/__glpk__.cc,
libinterp/dldfcn/__init_fltk__.cc, libinterp/dldfcn/__init_gnuplot__.cc,
libinterp/dldfcn/__magick_read__.cc, libinterp/dldfcn/__voronoi__.cc,
libinterp/dldfcn/amd.cc, libinterp/dldfcn/ccolamd.cc, libinterp/dldfcn/chol.cc,
libinterp/dldfcn/colamd.cc, libinterp/dldfcn/convhulln.cc,
libinterp/dldfcn/dmperm.cc, libinterp/dldfcn/fftw.cc, libinterp/dldfcn/qr.cc,
libinterp/dldfcn/symbfact.cc, libinterp/dldfcn/symrcm.cc,
libinterp/dldfcn/tsearch.cc, libinterp/octave-value/ov-base-diag.cc,
libinterp/octave-value/ov-base-diag.h, libinterp/octave-value/ov-base-int.cc,
libinterp/octave-value/ov-base-int.h, libinterp/octave-value/ov-base-mat.h,
libinterp/octave-value/ov-base-scalar.cc,
libinterp/octave-value/ov-base-scalar.h,
libinterp/octave-value/ov-base-sparse.cc,
libinterp/octave-value/ov-base-sparse.h, libinterp/octave-value/ov-base.cc,
libinterp/octave-value/ov-base.h, libinterp/octave-value/ov-bool-mat.cc,
libinterp/octave-value/ov-bool-mat.h, libinterp/octave-value/ov-bool-sparse.cc,
libinterp/octave-value/ov-bool-sparse.h, libinterp/octave-value/ov-bool.cc,
libinterp/octave-value/ov-bool.h, libinterp/octave-value/ov-builtin.cc,
libinterp/octave-value/ov-builtin.h, libinterp/octave-value/ov-cell.cc,
libinterp/octave-value/ov-cell.h, libinterp/octave-value/ov-ch-mat.cc,
libinterp/octave-value/ov-ch-mat.h, libinterp/octave-value/ov-class.cc,
libinterp/octave-value/ov-class.h, libinterp/octave-value/ov-colon.h,
libinterp/octave-value/ov-complex.cc, libinterp/octave-value/ov-complex.h,
libinterp/octave-value/ov-cx-diag.cc, libinterp/octave-value/ov-cx-diag.h,
libinterp/octave-value/ov-cx-mat.cc, libinterp/octave-value/ov-cx-mat.h,
libinterp/octave-value/ov-cx-sparse.cc, libinterp/octave-value/ov-cx-sparse.h,
libinterp/octave-value/ov-dld-fcn.h, libinterp/octave-value/ov-fcn-handle.cc,
libinterp/octave-value/ov-fcn-handle.h,
libinterp/octave-value/ov-fcn-inline.cc,
libinterp/octave-value/ov-fcn-inline.h, libinterp/octave-value/ov-fcn.h,
libinterp/octave-value/ov-float.cc, libinterp/octave-value/ov-float.h,
libinterp/octave-value/ov-flt-complex.cc,
libinterp/octave-value/ov-flt-complex.h,
libinterp/octave-value/ov-flt-cx-diag.cc,
libinterp/octave-value/ov-flt-cx-diag.h,
libinterp/octave-value/ov-flt-cx-mat.cc,
libinterp/octave-value/ov-flt-cx-mat.h,
libinterp/octave-value/ov-flt-re-diag.cc,
libinterp/octave-value/ov-flt-re-diag.h,
libinterp/octave-value/ov-flt-re-mat.cc,
libinterp/octave-value/ov-flt-re-mat.h, libinterp/octave-value/ov-int16.cc,
libinterp/octave-value/ov-int32.cc, libinterp/octave-value/ov-int64.cc,
libinterp/octave-value/ov-int8.cc, libinterp/octave-value/ov-intx.h,
libinterp/octave-value/ov-java.cc, libinterp/octave-value/ov-lazy-idx.h,
libinterp/octave-value/ov-mex-fcn.cc, libinterp/octave-value/ov-mex-fcn.h,
libinterp/octave-value/ov-null-mat.cc, libinterp/octave-value/ov-null-mat.h,
libinterp/octave-value/ov-oncleanup.cc, libinterp/octave-value/ov-perm.cc,
libinterp/octave-value/ov-perm.h, libinterp/octave-value/ov-range.cc,
libinterp/octave-value/ov-range.h, libinterp/octave-value/ov-re-diag.cc,
libinterp/octave-value/ov-re-diag.h, libinterp/octave-value/ov-re-mat.cc,
libinterp/octave-value/ov-re-mat.h, libinterp/octave-value/ov-re-sparse.cc,
libinterp/octave-value/ov-re-sparse.h, libinterp/octave-value/ov-scalar.cc,
libinterp/octave-value/ov-scalar.h, libinterp/octave-value/ov-str-mat.cc,
libinterp/octave-value/ov-str-mat.h, libinterp/octave-value/ov-struct.cc,
libinterp/octave-value/ov-struct.h, libinterp/octave-value/ov-type-conv.h,
libinterp/octave-value/ov-typeinfo.cc, libinterp/octave-value/ov-typeinfo.h,
libinterp/octave-value/ov-uint16.cc, libinterp/octave-value/ov-uint32.cc,
libinterp/octave-value/ov-uint64.cc, libinterp/octave-value/ov-uint8.cc,
libinterp/octave-value/ov-usr-fcn.cc, libinterp/octave-value/ov-usr-fcn.h,
libinterp/octave-value/ov.cc, libinterp/octave-value/ov.h, libinterp/octave.cc,
libinterp/operators/op-b-bm.cc, libinterp/operators/op-b-sbm.cc,
libinterp/operators/op-bm-b.cc, libinterp/operators/op-bm-bm.cc,
libinterp/operators/op-cdm-cdm.cc, libinterp/operators/op-chm.cc,
libinterp/operators/op-class.cc, libinterp/operators/op-cm-cm.cc,
libinterp/operators/op-cm-cs.cc, libinterp/operators/op-cm-s.cc,
libinterp/operators/op-cm-scm.cc, libinterp/operators/op-cm-sm.cc,
libinterp/operators/op-cs-cm.cc, libinterp/operators/op-cs-cs.cc,
libinterp/operators/op-cs-scm.cc, libinterp/operators/op-cs-sm.cc,
libinterp/operators/op-dm-dm.cc, libinterp/operators/op-dm-scm.cc,
libinterp/operators/op-double-conv.cc, libinterp/operators/op-fcdm-fcdm.cc,
libinterp/operators/op-fcm-fcm.cc, libinterp/operators/op-fcm-fcs.cc,
libinterp/operators/op-fcm-fm.cc, libinterp/operators/op-fcm-fs.cc,
libinterp/operators/op-fcs-fcm.cc, libinterp/operators/op-fcs-fcs.cc,
libinterp/operators/op-fcs-fm.cc, libinterp/operators/op-fcs-fs.cc,
libinterp/operators/op-fdm-fdm.cc, libinterp/operators/op-float-conv.cc,
libinterp/operators/op-fm-fcm.cc, libinterp/operators/op-fm-fcs.cc,
libinterp/operators/op-fm-fm.cc, libinterp/operators/op-fm-fs.cc,
libinterp/operators/op-fs-fcm.cc, libinterp/operators/op-fs-fcs.cc,
libinterp/operators/op-fs-fm.cc, libinterp/operators/op-fs-fs.cc,
libinterp/operators/op-m-cm.cc, libinterp/operators/op-m-cs.cc,
libinterp/operators/op-m-m.cc, libinterp/operators/op-m-s.cc,
libinterp/operators/op-m-scm.cc, libinterp/operators/op-m-sm.cc,
libinterp/operators/op-pm-scm.cc, libinterp/operators/op-range.cc,
libinterp/operators/op-s-cm.cc, libinterp/operators/op-s-cs.cc,
libinterp/operators/op-s-scm.cc, libinterp/operators/op-sbm-b.cc,
libinterp/operators/op-sbm-bm.cc, libinterp/operators/op-sbm-sbm.cc,
libinterp/operators/op-scm-cm.cc, libinterp/operators/op-scm-cs.cc,
libinterp/operators/op-scm-m.cc, libinterp/operators/op-scm-s.cc,
libinterp/operators/op-scm-scm.cc, libinterp/operators/op-scm-sm.cc,
libinterp/operators/op-sm-cm.cc, libinterp/operators/op-sm-m.cc,
libinterp/operators/op-sm-s.cc, libinterp/operators/op-sm-scm.cc,
libinterp/operators/op-sm-sm.cc, libinterp/operators/op-str-m.cc,
libinterp/operators/op-str-s.cc, libinterp/operators/op-str-str.cc,
libinterp/operators/ops.h, libinterp/parse-tree/lex.h,
libinterp/parse-tree/parse.h, libinterp/parse-tree/pt-arg-list.cc,
libinterp/parse-tree/pt-arg-list.h, libinterp/parse-tree/pt-assign.cc,
libinterp/parse-tree/pt-assign.h, libinterp/parse-tree/pt-binop.cc,
libinterp/parse-tree/pt-binop.h, libinterp/parse-tree/pt-bp.h,
libinterp/parse-tree/pt-cbinop.cc, libinterp/parse-tree/pt-check.cc,
libinterp/parse-tree/pt-colon.cc, libinterp/parse-tree/pt-colon.h,
libinterp/parse-tree/pt-const.cc, libinterp/parse-tree/pt-decl.cc,
libinterp/parse-tree/pt-decl.h, libinterp/parse-tree/pt-eval.cc,
libinterp/parse-tree/pt-except.h, libinterp/parse-tree/pt-exp.h,
libinterp/parse-tree/pt-fcn-handle.cc, libinterp/parse-tree/pt-id.cc,
libinterp/parse-tree/pt-id.h, libinterp/parse-tree/pt-idx.cc,
libinterp/parse-tree/pt-idx.h, libinterp/parse-tree/pt-loop.h,
libinterp/parse-tree/pt-mat.cc, libinterp/parse-tree/pt-misc.cc,
libinterp/parse-tree/pt-misc.h, libinterp/parse-tree/pt-pr-code.cc,
libinterp/parse-tree/pt-select.h, libinterp/parse-tree/pt-stmt.h,
libinterp/parse-tree/token.h, libinterp/version.cc:
Use GNU style coding conventions for code in libinterp/
author | Rik <rik@octave.org> |
---|---|
date | Mon, 28 Oct 2013 19:51:46 -0700 |
parents | d63878346099 |
children | 8c33abdd2f9a |
comparison
equal
deleted
inserted
replaced
17786:34d9812a943b | 17787:175b392e91fe |
---|---|
164 { | 164 { |
165 int index = 0; | 165 int index = 0; |
166 | 166 |
167 vm_args.nOptions = java_opts.size (); | 167 vm_args.nOptions = java_opts.size (); |
168 vm_args.options = new JavaVMOption [vm_args.nOptions]; | 168 vm_args.options = new JavaVMOption [vm_args.nOptions]; |
169 for (std::list<std::string>::const_iterator it = java_opts.begin (); it != java_opts.end (); ++it) | 169 for (std::list<std::string>::const_iterator it = java_opts.begin (); |
170 it != java_opts.end (); ++it) | |
170 { | 171 { |
171 if (Vdebug_java) | 172 if (Vdebug_java) |
172 std::cout << *it << std::endl; | 173 std::cout << *it << std::endl; |
173 vm_args.options[index++].optionString = strsave ((*it).c_str ()); | 174 vm_args.options[index++].optionString = strsave ((*it).c_str ()); |
174 } | 175 } |
195 if (! RegOpenKeyEx (HKEY_LOCAL_MACHINE, key.c_str (), 0, KEY_READ, &hkey)) | 196 if (! RegOpenKeyEx (HKEY_LOCAL_MACHINE, key.c_str (), 0, KEY_READ, &hkey)) |
196 { | 197 { |
197 if (! RegQueryValueEx (hkey, value.c_str (), 0, 0, 0, &len)) | 198 if (! RegQueryValueEx (hkey, value.c_str (), 0, 0, 0, &len)) |
198 { | 199 { |
199 retval.resize (len); | 200 retval.resize (len); |
200 if (RegQueryValueEx (hkey, value.c_str (), 0, 0, (LPBYTE)&retval[0], &len)) | 201 if (RegQueryValueEx (hkey, value.c_str (), 0, 0, |
202 (LPBYTE)&retval[0], &len)) | |
201 retval = ""; | 203 retval = ""; |
202 else if (retval[len-1] == '\0') | 204 else if (retval[len-1] == '\0') |
203 retval.resize (--len); | 205 retval.resize (--len); |
204 } | 206 } |
205 RegCloseKey (hkey); | 207 RegCloseKey (hkey); |
243 static bool first = true; | 245 static bool first = true; |
244 | 246 |
245 if (! dllfcn && first) | 247 if (! dllfcn && first) |
246 { | 248 { |
247 HINSTANCE hKernel32 = GetModuleHandle ("kernel32"); | 249 HINSTANCE hKernel32 = GetModuleHandle ("kernel32"); |
248 dllfcn = reinterpret_cast<dllfcn_t> (GetProcAddress (hKernel32, "SetDllDirectoryA")); | 250 dllfcn = reinterpret_cast<dllfcn_t> (GetProcAddress (hKernel32, |
251 "SetDllDirectoryA")); | |
249 first = false; | 252 first = false; |
250 } | 253 } |
251 | 254 |
252 if (dllfcn) | 255 if (dllfcn) |
253 dllfcn (dir.empty () ? NULL : dir.c_str ()); | 256 dllfcn (dir.empty () ? NULL : dir.c_str ()); |
506 if (! old_cwd.empty ()) | 509 if (! old_cwd.empty ()) |
507 octave_env::chdir (old_cwd); | 510 octave_env::chdir (old_cwd); |
508 | 511 |
509 #endif | 512 #endif |
510 | 513 |
511 JNI_CreateJavaVM_t create_vm = reinterpret_cast<JNI_CreateJavaVM_t> (lib.search ("JNI_CreateJavaVM")); | 514 JNI_CreateJavaVM_t create_vm = |
512 JNI_GetCreatedJavaVMs_t get_vm = reinterpret_cast<JNI_GetCreatedJavaVMs_t> (lib.search ("JNI_GetCreatedJavaVMs")); | 515 reinterpret_cast<JNI_CreateJavaVM_t> (lib.search ("JNI_CreateJavaVM")); |
516 JNI_GetCreatedJavaVMs_t get_vm = | |
517 reinterpret_cast<JNI_GetCreatedJavaVMs_t> (lib.search ("JNI_GetCreatedJavaVMs")); | |
513 | 518 |
514 if (!create_vm) | 519 if (!create_vm) |
515 throw std::string ("unable to find JNI_CreateJavaVM in ") + jvm_lib_path; | 520 throw std::string ("unable to find JNI_CreateJavaVM in ") + jvm_lib_path; |
516 | 521 |
517 if (!get_vm) | 522 if (!get_vm) |
538 // Attach the current thread | 543 // Attach the current thread |
539 JavaVMAttachArgs vm_args; | 544 JavaVMAttachArgs vm_args; |
540 vm_args.version = JNI_VERSION_1_2; | 545 vm_args.version = JNI_VERSION_1_2; |
541 vm_args.name = const_cast<char *> ("octave"); | 546 vm_args.name = const_cast<char *> ("octave"); |
542 vm_args.group = NULL; | 547 vm_args.group = NULL; |
543 if (jvm->AttachCurrentThread (reinterpret_cast<void **> (¤t_env), &vm_args) < 0) | 548 if (jvm->AttachCurrentThread (reinterpret_cast<void **> (¤t_env), |
549 &vm_args) < 0) | |
544 throw std::string ("JVM internal error, unable to attach octave to existing JVM"); | 550 throw std::string ("JVM internal error, unable to attach octave to existing JVM"); |
545 break; | 551 break; |
546 | 552 |
547 case JNI_EVERSION: | 553 case JNI_EVERSION: |
548 throw std::string ("JVM internal error, the required JNI version is not supported"); | 554 throw std::string ("JVM internal error, the required JNI version is not supported"); |
633 { | 639 { |
634 jclass_ref cls (jni_env, jni_env->FindClass ("java/lang/String")); | 640 jclass_ref cls (jni_env, jni_env->FindClass ("java/lang/String")); |
635 if (cls) | 641 if (cls) |
636 { | 642 { |
637 if (jni_env->IsInstanceOf (obj, cls)) | 643 if (jni_env->IsInstanceOf (obj, cls)) |
638 retval = jstring_to_string (jni_env, reinterpret_cast<jstring> (obj)); | 644 retval = jstring_to_string (jni_env, |
645 reinterpret_cast<jstring> (obj)); | |
639 } | 646 } |
640 } | 647 } |
641 | 648 |
642 return retval; | 649 return retval; |
643 } | 650 } |
669 jni_env->ExceptionDescribe (); | 676 jni_env->ExceptionDescribe (); |
670 | 677 |
671 jni_env->ExceptionClear (); | 678 jni_env->ExceptionClear (); |
672 | 679 |
673 jclass_ref jcls (jni_env, jni_env->GetObjectClass (ex)); | 680 jclass_ref jcls (jni_env, jni_env->GetObjectClass (ex)); |
674 jmethodID mID = jni_env->GetMethodID (jcls, "toString", "()Ljava/lang/String;"); | 681 jmethodID mID = jni_env->GetMethodID (jcls, "toString", |
675 jstring_ref js (jni_env, reinterpret_cast<jstring> (jni_env->CallObjectMethod (ex, mID))); | 682 "()Ljava/lang/String;"); |
683 jstring_ref js (jni_env, | |
684 reinterpret_cast<jstring> (jni_env->CallObjectMethod (ex, mID))); | |
676 std::string msg = jstring_to_string (jni_env, js); | 685 std::string msg = jstring_to_string (jni_env, js); |
677 | 686 |
678 error ("[java] %s", msg.c_str ()); | 687 error ("[java] %s", msg.c_str ()); |
679 } | 688 } |
680 else | 689 else |
697 | 706 |
698 if (! uiClass) | 707 if (! uiClass) |
699 { | 708 { |
700 if (class_loader.empty ()) | 709 if (class_loader.empty ()) |
701 { | 710 { |
702 jclass_ref syscls (jni_env, jni_env->FindClass ("java/lang/System")); | 711 jclass_ref syscls (jni_env, |
712 jni_env->FindClass ("java/lang/System")); | |
703 jmethodID mID = jni_env->GetStaticMethodID (syscls, "getProperty", "(Ljava/lang/String;)Ljava/lang/String;"); | 713 jmethodID mID = jni_env->GetStaticMethodID (syscls, "getProperty", "(Ljava/lang/String;)Ljava/lang/String;"); |
704 jstring_ref js (jni_env, jni_env->NewStringUTF ("octave.class.loader")); | 714 jstring_ref js (jni_env, jni_env->NewStringUTF ("octave.class.loader")); |
705 js = reinterpret_cast<jstring> (jni_env->CallStaticObjectMethod (syscls, mID, jstring (js))); | 715 js = reinterpret_cast<jstring> (jni_env->CallStaticObjectMethod (syscls, mID, jstring (js))); |
706 class_loader = jstring_to_string (jni_env, jstring (js)); | 716 class_loader = jstring_to_string (jni_env, jstring (js)); |
707 std::replace (class_loader.begin (), class_loader.end (), '.', '/'); | 717 std::replace (class_loader.begin (), class_loader.end (), '.', '/'); |
1146 { | 1156 { |
1147 Matrix m; | 1157 Matrix m; |
1148 | 1158 |
1149 for (int r = 0; r < rows; r++) | 1159 for (int r = 0; r < rows; r++) |
1150 { | 1160 { |
1151 jdoubleArray_ref row (jni_env, reinterpret_cast<jdoubleArray> (jni_env->GetObjectArrayElement (jarr, r))); | 1161 jdoubleArray_ref row (jni_env, |
1162 reinterpret_cast<jdoubleArray> (jni_env->GetObjectArrayElement (jarr, r))); | |
1152 | 1163 |
1153 if (m.length () == 0) | 1164 if (m.length () == 0) |
1154 { | 1165 { |
1155 cols = jni_env->GetArrayLength (row); | 1166 cols = jni_env->GetArrayLength (row); |
1156 m.resize (cols, rows); | 1167 m.resize (cols, rows); |
1174 int len = jni_env->GetArrayLength (jarr); | 1185 int len = jni_env->GetArrayLength (jarr); |
1175 Cell m (len, 1); | 1186 Cell m (len, 1); |
1176 | 1187 |
1177 for (int i = 0; i < len; i++) | 1188 for (int i = 0; i < len; i++) |
1178 { | 1189 { |
1179 jstring_ref js (jni_env, reinterpret_cast<jstring> (jni_env->GetObjectArrayElement (jarr, i))); | 1190 jstring_ref js (jni_env, |
1191 reinterpret_cast<jstring> (jni_env->GetObjectArrayElement (jarr, i))); | |
1180 m(i) = jstring_to_string (jni_env, js); | 1192 m(i) = jstring_to_string (jni_env, js); |
1181 } | 1193 } |
1182 | 1194 |
1183 retval = m; | 1195 retval = m; |
1184 } | 1196 } |
1284 | 1296 |
1285 if (val.is_double_type ()) | 1297 if (val.is_double_type ()) |
1286 { | 1298 { |
1287 NDArray m = val.array_value (); | 1299 NDArray m = val.array_value (); |
1288 jdoubleArray_ref dv (jni_env, jni_env->NewDoubleArray (m.length ())); | 1300 jdoubleArray_ref dv (jni_env, jni_env->NewDoubleArray (m.length ())); |
1289 jni_env->SetDoubleArrayRegion (jdoubleArray (dv), 0, m.length (), m.fortran_vec ()); | 1301 jni_env->SetDoubleArrayRegion (jdoubleArray (dv), 0, m.length (), |
1302 m.fortran_vec ()); | |
1290 jmethodID mID = jni_env->GetMethodID (mcls, "<init>", "([D[I)V"); | 1303 jmethodID mID = jni_env->GetMethodID (mcls, "<init>", "([D[I)V"); |
1291 jobj = jni_env->NewObject (jclass (mcls), mID, jdoubleArray (dv), jintArray (iv)); | 1304 jobj = jni_env->NewObject (jclass (mcls), mID, jdoubleArray (dv), |
1305 jintArray (iv)); | |
1292 jcls = jni_env->GetObjectClass (jobj); | 1306 jcls = jni_env->GetObjectClass (jobj); |
1293 } | 1307 } |
1294 else if (val.is_int8_type ()) | 1308 else if (val.is_int8_type ()) |
1295 { | 1309 { |
1296 int8NDArray m = val.int8_array_value (); | 1310 int8NDArray m = val.int8_array_value (); |
1297 jbyteArray_ref bv (jni_env, jni_env->NewByteArray (m.length ())); | 1311 jbyteArray_ref bv (jni_env, jni_env->NewByteArray (m.length ())); |
1298 jni_env->SetByteArrayRegion (jbyteArray (bv), 0, m.length (), reinterpret_cast <jbyte *> (m.fortran_vec ())); | 1312 jni_env->SetByteArrayRegion (jbyteArray (bv), 0, m.length (), |
1313 reinterpret_cast <jbyte *> (m.fortran_vec ())); | |
1299 jmethodID mID = jni_env->GetMethodID (mcls, "<init>", "([B[I)V"); | 1314 jmethodID mID = jni_env->GetMethodID (mcls, "<init>", "([B[I)V"); |
1300 jobj = jni_env->NewObject (jclass (mcls), mID, jbyteArray (bv), jintArray (iv)); | 1315 jobj = jni_env->NewObject (jclass (mcls), mID, jbyteArray (bv), jintArray (iv)); |
1301 jcls = jni_env->GetObjectClass (jobj); | 1316 jcls = jni_env->GetObjectClass (jobj); |
1302 } | 1317 } |
1303 else if (val.is_uint8_type ()) | 1318 else if (val.is_uint8_type ()) |
1304 { | 1319 { |
1305 uint8NDArray m = val.uint8_array_value (); | 1320 uint8NDArray m = val.uint8_array_value (); |
1306 jbyteArray_ref bv (jni_env, jni_env->NewByteArray (m.length ())); | 1321 jbyteArray_ref bv (jni_env, jni_env->NewByteArray (m.length ())); |
1307 jni_env->SetByteArrayRegion (jbyteArray (bv), 0, m.length (), reinterpret_cast<jbyte *> (m.fortran_vec ())); | 1322 jni_env->SetByteArrayRegion (jbyteArray (bv), 0, m.length (), |
1323 reinterpret_cast<jbyte *> (m.fortran_vec ())); | |
1308 jmethodID mID = jni_env->GetMethodID (mcls, "<init>", "([B[I)V"); | 1324 jmethodID mID = jni_env->GetMethodID (mcls, "<init>", "([B[I)V"); |
1309 jobj = jni_env->NewObject (jclass (mcls), mID, jbyteArray (bv), jintArray (iv)); | 1325 jobj = jni_env->NewObject (jclass (mcls), mID, jbyteArray (bv), jintArray (iv)); |
1310 jcls = jni_env->GetObjectClass (jobj); | 1326 jcls = jni_env->GetObjectClass (jobj); |
1311 } | 1327 } |
1312 else if (val.is_int32_type ()) | 1328 else if (val.is_int32_type ()) |
1313 { | 1329 { |
1314 int32NDArray m = val.int32_array_value (); | 1330 int32NDArray m = val.int32_array_value (); |
1315 jintArray_ref v (jni_env, jni_env->NewIntArray (m.length ())); | 1331 jintArray_ref v (jni_env, jni_env->NewIntArray (m.length ())); |
1316 jni_env->SetIntArrayRegion (jintArray (v), 0, m.length (), reinterpret_cast<jint *> (m.fortran_vec ())); | 1332 jni_env->SetIntArrayRegion (jintArray (v), 0, m.length (), |
1333 reinterpret_cast<jint *> (m.fortran_vec ())); | |
1317 jmethodID mID = jni_env->GetMethodID (mcls, "<init>", "([I[I)V"); | 1334 jmethodID mID = jni_env->GetMethodID (mcls, "<init>", "([I[I)V"); |
1318 jobj = jni_env->NewObject (jclass (mcls), mID, jintArray (v), jintArray (iv)); | 1335 jobj = jni_env->NewObject (jclass (mcls), mID, jintArray (v), jintArray (iv)); |
1319 jcls = jni_env->GetObjectClass (jobj); | 1336 jcls = jni_env->GetObjectClass (jobj); |
1320 } | 1337 } |
1321 else | 1338 else |
1329 Cell cellStr = val.cell_value (); | 1346 Cell cellStr = val.cell_value (); |
1330 jclass_ref scls (jni_env, jni_env->FindClass ("java/lang/String")); | 1347 jclass_ref scls (jni_env, jni_env->FindClass ("java/lang/String")); |
1331 jobjectArray array = jni_env->NewObjectArray (cellStr.length (), scls, 0); | 1348 jobjectArray array = jni_env->NewObjectArray (cellStr.length (), scls, 0); |
1332 for (int i = 0; i < cellStr.length (); i++) | 1349 for (int i = 0; i < cellStr.length (); i++) |
1333 { | 1350 { |
1334 jstring_ref jstr (jni_env, jni_env->NewStringUTF (cellStr(i).string_value().c_str ())); | 1351 jstring_ref jstr (jni_env, |
1352 jni_env->NewStringUTF (cellStr(i).string_value().c_str ())); | |
1335 jni_env->SetObjectArrayElement (array, i, jstr); | 1353 jni_env->SetObjectArrayElement (array, i, jstr); |
1336 } | 1354 } |
1337 jobj = array; | 1355 jobj = array; |
1338 jcls = jni_env->GetObjectClass (jobj); | 1356 jcls = jni_env->GetObjectClass (jobj); |
1339 } | 1357 } |
1558 | 1576 |
1559 void | 1577 void |
1560 octave_java::register_type (void) | 1578 octave_java::register_type (void) |
1561 { | 1579 { |
1562 t_id = octave_value_typeinfo::register_type | 1580 t_id = octave_value_typeinfo::register_type |
1563 (octave_java::t_name, "<unknown>", octave_value (new octave_java ())); | 1581 (octave_java::t_name, "<unknown>", octave_value (new octave_java ())); |
1564 } | 1582 } |
1565 | 1583 |
1566 dim_vector | 1584 dim_vector |
1567 octave_java::dims (void) const | 1585 octave_java::dims (void) const |
1568 { | 1586 { |
1643 | 1661 |
1644 JNIEnv *current_env = thread_jni_env (); | 1662 JNIEnv *current_env = thread_jni_env (); |
1645 | 1663 |
1646 switch (type[0]) | 1664 switch (type[0]) |
1647 { | 1665 { |
1648 case '.': | 1666 case '.': |
1649 if (type.length () == 1) | 1667 if (type.length () == 1) |
1650 { | 1668 { |
1651 // field assignment | 1669 // field assignment |
1652 octave_value_list ovl; | 1670 octave_value_list ovl; |
1653 count++; | 1671 count++; |
1654 ovl(0) = octave_value (this); | 1672 ovl(0) = octave_value (this); |
1655 ovl(1) = (idx.front ())(0); | 1673 ovl(1) = (idx.front ())(0); |
1656 ovl(2) = rhs; | 1674 ovl(2) = rhs; |
1657 feval ("__java_set__", ovl, 0); | 1675 feval ("__java_set__", ovl, 0); |
1658 if (! error_state) | 1676 if (! error_state) |
1659 { | 1677 { |
1660 count++; | 1678 count++; |
1661 retval = octave_value (this); | 1679 retval = octave_value (this); |
1662 } | 1680 } |
1663 } | 1681 } |
1664 else if (type.length () > 2 && type[1] == '(') | 1682 else if (type.length () > 2 && type[1] == '(') |
1665 { | 1683 { |
1666 std::list<octave_value_list> new_idx; | 1684 std::list<octave_value_list> new_idx; |
1667 std::list<octave_value_list>::const_iterator it = idx.begin (); | 1685 std::list<octave_value_list>::const_iterator it = idx.begin (); |
1668 new_idx.push_back (*it++); | 1686 new_idx.push_back (*it++); |
1669 new_idx.push_back (*it++); | 1687 new_idx.push_back (*it++); |
1670 octave_value_list u = subsref (type.substr (0, 2), new_idx, 1); | 1688 octave_value_list u = subsref (type.substr (0, 2), new_idx, 1); |
1671 if (! error_state) | 1689 if (! error_state) |
1672 { | 1690 { |
1673 std::list<octave_value_list> next_idx (idx); | 1691 std::list<octave_value_list> next_idx (idx); |
1674 next_idx.erase (next_idx.begin ()); | 1692 next_idx.erase (next_idx.begin ()); |
1675 next_idx.erase (next_idx.begin ()); | 1693 next_idx.erase (next_idx.begin ()); |
1676 u(0).subsasgn (type.substr (2), next_idx, rhs); | 1694 u(0).subsasgn (type.substr (2), next_idx, rhs); |
1677 if (! error_state) | 1695 if (! error_state) |
1678 { | 1696 { |
1679 count++; | 1697 count++; |
1680 retval = octave_value (this); | 1698 retval = octave_value (this); |
1681 } | 1699 } |
1682 } | 1700 } |
1683 } | 1701 } |
1684 else if (type[1] == '.') | 1702 else if (type[1] == '.') |
1685 { | 1703 { |
1686 octave_value_list u = subsref (type.substr (0, 1), idx, 1); | 1704 octave_value_list u = subsref (type.substr (0, 1), idx, 1); |
1687 if (! error_state) | 1705 if (! error_state) |
1688 { | 1706 { |
1689 std::list<octave_value_list> next_idx (idx); | 1707 std::list<octave_value_list> next_idx (idx); |
1690 next_idx.erase (next_idx.begin ()); | 1708 next_idx.erase (next_idx.begin ()); |
1691 u(0).subsasgn (type.substr (1), next_idx, rhs); | 1709 u(0).subsasgn (type.substr (1), next_idx, rhs); |
1692 if (! error_state) | 1710 if (! error_state) |
1693 { | 1711 { |
1694 count++; | 1712 count++; |
1695 retval = octave_value (this); | 1713 retval = octave_value (this); |
1696 } | 1714 } |
1697 } | 1715 } |
1698 } | 1716 } |
1699 else | 1717 else |
1700 error ("invalid indexing/assignment on Java object"); | 1718 error ("invalid indexing/assignment on Java object"); |
1701 break; | 1719 break; |
1702 | 1720 |
1703 case '(': | 1721 case '(': |
1704 if (current_env) | 1722 if (current_env) |
1705 { | 1723 { |
1706 set_array_elements (current_env, to_java (), idx.front (), rhs); | 1724 set_array_elements (current_env, to_java (), idx.front (), rhs); |
1707 if (! error_state) | 1725 if (! error_state) |
1708 { | 1726 { |
1709 count++; | 1727 count++; |
1710 retval = octave_value (this); | 1728 retval = octave_value (this); |
1711 } | 1729 } |
1712 } | 1730 } |
1713 break; | 1731 break; |
1714 | 1732 |
1715 default: | 1733 default: |
1716 error ("Java object cannot be indexed with %c", type[0]); | 1734 error ("Java object cannot be indexed with %c", type[0]); |
1717 break; | 1735 break; |
1718 } | 1736 } |
1719 | 1737 |
1720 return retval; | 1738 return retval; |
1721 } | 1739 } |
1722 | 1740 |
1755 os << "<Java object: " << java_classname << ">"; | 1773 os << "<Java object: " << java_classname << ">"; |
1756 } | 1774 } |
1757 | 1775 |
1758 octave_value | 1776 octave_value |
1759 octave_java::do_javaMethod (JNIEnv* jni_env, const std::string& name, | 1777 octave_java::do_javaMethod (JNIEnv* jni_env, const std::string& name, |
1760 const octave_value_list& args) | 1778 const octave_value_list& args) |
1761 { | 1779 { |
1762 octave_value retval; | 1780 octave_value retval; |
1763 | 1781 |
1764 if (jni_env) | 1782 if (jni_env) |
1765 { | 1783 { |
1784 return retval; | 1802 return retval; |
1785 } | 1803 } |
1786 | 1804 |
1787 octave_value | 1805 octave_value |
1788 octave_java:: do_javaMethod (JNIEnv* jni_env, | 1806 octave_java:: do_javaMethod (JNIEnv* jni_env, |
1789 const std::string& class_name, | 1807 const std::string& class_name, |
1790 const std::string& name, | 1808 const std::string& name, |
1791 const octave_value_list& args) | 1809 const octave_value_list& args) |
1792 { | 1810 { |
1793 octave_value retval; | 1811 octave_value retval; |
1794 | 1812 |
1795 if (jni_env) | 1813 if (jni_env) |
1796 { | 1814 { |
1816 return retval; | 1834 return retval; |
1817 } | 1835 } |
1818 | 1836 |
1819 octave_value | 1837 octave_value |
1820 octave_java::do_javaObject (JNIEnv* jni_env, const std::string& name, | 1838 octave_java::do_javaObject (JNIEnv* jni_env, const std::string& name, |
1821 const octave_value_list& args) | 1839 const octave_value_list& args) |
1822 { | 1840 { |
1823 octave_value retval; | 1841 octave_value retval; |
1824 | 1842 |
1825 if (jni_env) | 1843 if (jni_env) |
1826 { | 1844 { |
1957 | 1975 |
1958 // DEFUN blocks below must be outside of HAVE_JAVA block so that | 1976 // DEFUN blocks below must be outside of HAVE_JAVA block so that |
1959 // documentation strings are always available, even when functions are not. | 1977 // documentation strings are always available, even when functions are not. |
1960 | 1978 |
1961 DEFUN (__java_init__, , , | 1979 DEFUN (__java_init__, , , |
1962 "-*- texinfo -*-\n\ | 1980 "-*- texinfo -*-\n\ |
1963 @deftypefn {Built-in Function} {} java_init ()\n\ | 1981 @deftypefn {Built-in Function} {} java_init ()\n\ |
1964 Internal function used @strong{only} when debugging Java interface.\n\ | 1982 Internal function used @strong{only} when debugging Java interface.\n\ |
1965 Function will directly call initialize_java() to create an instance of a JVM.\n\ | 1983 Function will directly call initialize_java() to create an instance of a JVM.\n\ |
1966 @end deftypefn") | 1984 @end deftypefn") |
1967 { | 1985 { |
1982 return octave_value (); | 2000 return octave_value (); |
1983 #endif | 2001 #endif |
1984 } | 2002 } |
1985 | 2003 |
1986 DEFUN (__java_exit__, , , | 2004 DEFUN (__java_exit__, , , |
1987 "-*- texinfo -*-\n\ | 2005 "-*- texinfo -*-\n\ |
1988 @deftypefn {Built-in Function} {} java_exit ()\n\ | 2006 @deftypefn {Built-in Function} {} java_exit ()\n\ |
1989 Internal function used @strong{only} when debugging Java interface.\n\ | 2007 Internal function used @strong{only} when debugging Java interface.\n\ |
1990 Function will directly call terminate_jvm() to destroy the current JVM\n\ | 2008 Function will directly call terminate_jvm() to destroy the current JVM\n\ |
1991 instance.\n\ | 2009 instance.\n\ |
1992 @end deftypefn") | 2010 @end deftypefn") |
1999 | 2017 |
2000 return octave_value (); | 2018 return octave_value (); |
2001 } | 2019 } |
2002 | 2020 |
2003 DEFUN (javaObject, args, , | 2021 DEFUN (javaObject, args, , |
2004 "-*- texinfo -*-\n\ | 2022 "-*- texinfo -*-\n\ |
2005 @deftypefn {Built-in Function} {@var{jobj} =} javaObject (@var{classname})\n\ | 2023 @deftypefn {Built-in Function} {@var{jobj} =} javaObject (@var{classname})\n\ |
2006 @deftypefnx {Built-in Function} {@var{jobj} =} javaObject (@var{classname}, @var{arg1}, @dots{})\n\ | 2024 @deftypefnx {Built-in Function} {@var{jobj} =} javaObject (@var{classname}, @var{arg1}, @dots{})\n\ |
2007 Create a Java object of class @var{classsname}, by calling the class\n\ | 2025 Create a Java object of class @var{classsname}, by calling the class\n\ |
2008 constructor with the arguments @var{arg1}, @dots{}\n\ | 2026 constructor with the arguments @var{arg1}, @dots{}\n\ |
2009 \n\ | 2027 \n\ |
2060 %% Create a Short and check if it really is a short, i.e. whether it overflows | 2078 %% Create a Short and check if it really is a short, i.e. whether it overflows |
2061 %! assert (javaObject ("java.lang.Short", 40000).doubleValue < 0); | 2079 %! assert (javaObject ("java.lang.Short", 40000).doubleValue < 0); |
2062 */ | 2080 */ |
2063 | 2081 |
2064 DEFUN (javaMethod, args, , | 2082 DEFUN (javaMethod, args, , |
2065 "-*- texinfo -*-\n\ | 2083 "-*- texinfo -*-\n\ |
2066 @deftypefn {Built-in Function} {@var{ret} =} javaMethod (@var{methodname}, @var{obj})\n\ | 2084 @deftypefn {Built-in Function} {@var{ret} =} javaMethod (@var{methodname}, @var{obj})\n\ |
2067 @deftypefnx {Built-in Function} {@var{ret} =} javaMethod (@var{methodname}, @var{obj}, @var{arg1}, @dots{})\n\ | 2085 @deftypefnx {Built-in Function} {@var{ret} =} javaMethod (@var{methodname}, @var{obj}, @var{arg1}, @dots{})\n\ |
2068 Invoke the method @var{methodname} on the Java object @var{obj} with the\n\ | 2086 Invoke the method @var{methodname} on the Java object @var{obj} with the\n\ |
2069 arguments @var{arg1}, @dots{} For static methods, @var{obj} can be a string\n\ | 2087 arguments @var{arg1}, @dots{} For static methods, @var{obj} can be a string\n\ |
2070 representing the fully qualified name of the corresponding class. The\n\ | 2088 representing the fully qualified name of the corresponding class. The\n\ |
2135 %! jver = strsplit (javaMethod ('getProperty', 'java.lang.System', 'java.version'), '.'); | 2153 %! jver = strsplit (javaMethod ('getProperty', 'java.lang.System', 'java.version'), '.'); |
2136 %! assert (isfinite (str2double (jver{1})) && isfinite (str2double (jver{2}))); | 2154 %! assert (isfinite (str2double (jver{1})) && isfinite (str2double (jver{2}))); |
2137 */ | 2155 */ |
2138 | 2156 |
2139 DEFUN (__java_get__, args, , | 2157 DEFUN (__java_get__, args, , |
2140 "-*- texinfo -*-\n\ | 2158 "-*- texinfo -*-\n\ |
2141 @deftypefn {Built-in Function} {@var{val} =} __java_get__ (@var{obj}, @var{name})\n\ | 2159 @deftypefn {Built-in Function} {@var{val} =} __java_get__ (@var{obj}, @var{name})\n\ |
2142 Get the value of the field @var{name} of the Java object @var{obj}. For\n\ | 2160 Get the value of the field @var{name} of the Java object @var{obj}. For\n\ |
2143 static fields, @var{obj} can be a string representing the fully qualified\n\ | 2161 static fields, @var{obj} can be a string representing the fully qualified\n\ |
2144 name of the corresponding class.\n\ | 2162 name of the corresponding class.\n\ |
2145 \n\ | 2163 \n\ |
2197 return octave_value (); | 2215 return octave_value (); |
2198 #endif | 2216 #endif |
2199 } | 2217 } |
2200 | 2218 |
2201 DEFUN (__java_set__, args, , | 2219 DEFUN (__java_set__, args, , |
2202 "-*- texinfo -*-\n\ | 2220 "-*- texinfo -*-\n\ |
2203 @deftypefn {Built-in Function} {@var{obj} =} __java_set__ (@var{obj}, @var{name}, @var{val})\n\ | 2221 @deftypefn {Built-in Function} {@var{obj} =} __java_set__ (@var{obj}, @var{name}, @var{val})\n\ |
2204 Set the value of the field @var{name} of the Java object @var{obj} to\n\ | 2222 Set the value of the field @var{name} of the Java object @var{obj} to\n\ |
2205 @var{val}. For static fields, @var{obj} can be a string representing the\n\ | 2223 @var{val}. For static fields, @var{obj} can be a string representing the\n\ |
2206 fully qualified named of the corresponding Java class.\n\ | 2224 fully qualified named of the corresponding Java class.\n\ |
2207 \n\ | 2225 \n\ |
2259 return octave_value (); | 2277 return octave_value (); |
2260 #endif | 2278 #endif |
2261 } | 2279 } |
2262 | 2280 |
2263 DEFUN (java2mat, args, , | 2281 DEFUN (java2mat, args, , |
2264 "-*- texinfo -*-\n\ | 2282 "-*- texinfo -*-\n\ |
2265 @deftypefn {Built-in Function} {} java2mat (@var{javaobj})\n\ | 2283 @deftypefn {Built-in Function} {} java2mat (@var{javaobj})\n\ |
2266 Undocumented internal function.\n\ | 2284 Undocumented internal function.\n\ |
2267 @end deftypefn") | 2285 @end deftypefn") |
2268 { | 2286 { |
2269 #ifdef HAVE_JAVA | 2287 #ifdef HAVE_JAVA |
2295 return octave_value (); | 2313 return octave_value (); |
2296 #endif | 2314 #endif |
2297 } | 2315 } |
2298 | 2316 |
2299 DEFUN (java_matrix_autoconversion, args, nargout, | 2317 DEFUN (java_matrix_autoconversion, args, nargout, |
2300 "-*- texinfo -*-\n\ | 2318 "-*- texinfo -*-\n\ |
2301 @deftypefn {Built-in Function} {@var{val} =} java_matrix_autoconversion ()\n\ | 2319 @deftypefn {Built-in Function} {@var{val} =} java_matrix_autoconversion ()\n\ |
2302 @deftypefnx {Built-in Function} {@var{old_val} =} java_matrix_autoconversion (@var{new_val})\n\ | 2320 @deftypefnx {Built-in Function} {@var{old_val} =} java_matrix_autoconversion (@var{new_val})\n\ |
2303 @deftypefnx {Built-in Function} {} java_matrix_autoconversion (@var{new_val}, \"local\")\n\ | 2321 @deftypefnx {Built-in Function} {} java_matrix_autoconversion (@var{new_val}, \"local\")\n\ |
2304 Query or set the internal variable that controls whether Java arrays are\n\ | 2322 Query or set the internal variable that controls whether Java arrays are\n\ |
2305 automatically converted to Octave matrices. The default value is false.\n\ | 2323 automatically converted to Octave matrices. The default value is false.\n\ |
2317 return octave_value (); | 2335 return octave_value (); |
2318 #endif | 2336 #endif |
2319 } | 2337 } |
2320 | 2338 |
2321 DEFUN (java_unsigned_autoconversion, args, nargout, | 2339 DEFUN (java_unsigned_autoconversion, args, nargout, |
2322 "-*- texinfo -*-\n\ | 2340 "-*- texinfo -*-\n\ |
2323 @deftypefn {Built-in Function} {@var{val} =} java_unsigned_autoconversion ()\n\ | 2341 @deftypefn {Built-in Function} {@var{val} =} java_unsigned_autoconversion ()\n\ |
2324 @deftypefnx {Built-in Function} {@var{old_val} =} java_unsigned_autoconversion (@var{new_val})\n\ | 2342 @deftypefnx {Built-in Function} {@var{old_val} =} java_unsigned_autoconversion (@var{new_val})\n\ |
2325 @deftypefnx {Built-in Function} {} java_unsigned_autoconversion (@var{new_val}, \"local\")\n\ | 2343 @deftypefnx {Built-in Function} {} java_unsigned_autoconversion (@var{new_val}, \"local\")\n\ |
2326 Query or set the internal variable that controls how integer classes are\n\ | 2344 Query or set the internal variable that controls how integer classes are\n\ |
2327 converted when @code{java_matrix_autoconversion} is enabled. When enabled,\n\ | 2345 converted when @code{java_matrix_autoconversion} is enabled. When enabled,\n\ |
2341 return octave_value (); | 2359 return octave_value (); |
2342 #endif | 2360 #endif |
2343 } | 2361 } |
2344 | 2362 |
2345 DEFUN (debug_java, args, nargout, | 2363 DEFUN (debug_java, args, nargout, |
2346 "-*- texinfo -*-\n\ | 2364 "-*- texinfo -*-\n\ |
2347 @deftypefn {Built-in Function} {@var{val} =} debug_java ()\n\ | 2365 @deftypefn {Built-in Function} {@var{val} =} debug_java ()\n\ |
2348 @deftypefnx {Built-in Function} {@var{old_val} =} debug_java (@var{new_val})\n\ | 2366 @deftypefnx {Built-in Function} {@var{old_val} =} debug_java (@var{new_val})\n\ |
2349 @deftypefnx {Built-in Function} {} debug_java (@var{new_val}, \"local\")\n\ | 2367 @deftypefnx {Built-in Function} {} debug_java (@var{new_val}, \"local\")\n\ |
2350 Query or set the internal variable that determines whether extra debugging\n\ | 2368 Query or set the internal variable that determines whether extra debugging\n\ |
2351 information regarding the initialization of the JVM and any Java exceptions\n\ | 2369 information regarding the initialization of the JVM and any Java exceptions\n\ |
2364 return octave_value (); | 2382 return octave_value (); |
2365 #endif | 2383 #endif |
2366 } | 2384 } |
2367 | 2385 |
2368 // Outside of #ifdef HAVE_JAVA because it is desirable to be able to | 2386 // Outside of #ifdef HAVE_JAVA because it is desirable to be able to |
2369 // test for the presence of a Java object without having Java installed. | 2387 // test for the presence of a Java object without having Java installed. |
2370 DEFUN (isjava, args, , | 2388 DEFUN (isjava, args, , |
2371 "-*- texinfo -*-\n\ | 2389 "-*- texinfo -*-\n\ |
2372 @deftypefn {Built-in Function} {} isjava (@var{x})\n\ | 2390 @deftypefn {Built-in Function} {} isjava (@var{x})\n\ |
2373 Return true if @var{x} is a Java object.\n\ | 2391 Return true if @var{x} is a Java object.\n\ |
2374 @seealso{class, typeinfo, isa, javaObject}\n\ | 2392 @seealso{class, typeinfo, isa, javaObject}\n\ |
2375 @end deftypefn") | 2393 @end deftypefn") |
2376 { | 2394 { |