Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - Português

Change language to:
English - Français - 日本語 - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Ajuda do Scilab >> Java from Scilab > jinvoke_db

jinvoke_db

Invoke a method of a Java object in using Java direct buffers

Syntax

ret = jinvoke_db(object, methodName [, varName_1 [, varName_2...]])

Parameters

object

A mlist typed _JObj or _JClass or a Scilab variable

methodName

A string giving the method name

varName_i

A string giving a Scilab variable name as argument

Description

Invoke the Java method (static or not) called methodName of the given object. A pointer on the Scilab variable named varNamei is got and a direct buffer is created. Take care: you should not keep any reference on a direct buffer. You have a direct access to the Scilab memory so if for one reason a Scilab variable is moved or destroyed, you risk to read or to write where you would not do it ! To avoid any problems, the limit of each buffer is set to 0.

Examples

c = jcompile("TestDirectBuffer",["import java.nio.DoubleBuffer;";
                                 "public class TestDirectBuffer {";
                                 "public static void increment(DoubleBuffer x) {";
                                 "for (int i = 0; i < x.capacity(); i++) x.put(i, x.get(i) + 1);";
                                 "}";
                                 "}"])
a = 1:10000;
b = a + 1; // only used to compare with the following...
jinvoke_db(c, "increment", "a");
and(a==b)

jremove c;

See also

  • jinvoke — Invoke a method of a Java object

History

VersionDescription
5.5.0 Function introduced. Based on the 'JIMS' module. The main difference in the behavior compared to the JIMS module is that jautoUnwrap is enabled by default.
Report an issue
<< jinvoke Java from Scilab jnewInstance >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 25 08:52:44 CET 2020