[doc] misc. fix & improvements
[scilab.git] / scilab / modules / external_objects_java / help / en_US / jwrap.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 *
4 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
5 * Copyright (C) 2010 - 2011 - Calixte DENIZET <calixte@contrib.scilab.org>
6 *
7  * Copyright (C) 2012 - 2016 - Scilab Enterprises
8  *
9  * This file is hereby licensed under the terms of the GNU GPL v2.0,
10  * pursuant to article 5.3.4 of the CeCILL v.2.1.
11  * This file was originally licensed under the terms of the CeCILL v2.1,
12  * and continues to be available under such terms.
13  * For more information, see the COPYING file which you should have received
14  * along with this program.
15 *
16 *
17 -->
18 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="jwrap">
19     <refnamediv>
20         <refname>jwrap</refname>
21         <refpurpose>Wrap a Scilab variable into a Java one if possible</refpurpose>
22     </refnamediv>
23     <refsynopsisdiv>
24         <title>Syntax</title>
25         <synopsis>
26             [jw_1, jw_2, ...] = jwrap(sc_1 [, sc_2 [, sc_3 [,... ]]])
27         </synopsis>
28     </refsynopsisdiv>
29     <refsection>
30         <title>Parameters</title>
31         <variablelist>
32             <varlistentry>
33                 <term>sc_i</term>
34                 <listitem>
35                     <para>A Scilab variable</para>
36                 </listitem>
37             </varlistentry>
38             <varlistentry>
39                 <term>jw_i</term>
40                 <listitem>
41                     <para>A Java wrapping of the corresponding Scilab variable</para>
42                 </listitem>
43             </varlistentry>
44         </variablelist>
45     </refsection>
46     <refsection>
47         <title>Description</title>
48         <para>
49             Wrap a Scilab variable into a Java one. For now, only the primitive type can be wrapped:
50             <simplelist type="inline">
51                 <member>constant (real not complex) into double;</member><member>string into String;</member><member>boolean into boolean;</member><member>int8 into byte;</member><member>uint8 into short;</member><member>int16 into short;</member><member>uint16 into int;</member><member>int32 into int;</member><member>uint32 into long.</member>
52             </simplelist>
53             The matrices are wrapped into arrays too, e.g. an int8 matrix 3x4 is wrapped into a
54             <literal>byte[3][4]</literal> or <literal>byte[4][3]</literal> depending on conversion
55             method which can be changed in using the command
56             <link linkend="jautoTranspose">jautoTranspose</link>.
57             You should take care that the range of the index is the same as in Java, so <literal>a(0)</literal> is valid.
58         </para>
59         <para>
60             It is possible to wrap into Java types float or char in using respectively <link linkend="jwrapinfloat">jwrapinfloat</link> and <link linkend="jwrapinchar">jwrapinchar</link>.
61         </para>
62     </refsection>
63     <refsection>
64         <title>Examples</title>
65         <programlisting role="example"><![CDATA[
66                [a,b,c] = jwrap(1, [1 2;3 4], ["hello" "world"]);
67                a, b(1, 1), c(1)
68       ]]></programlisting>
69     </refsection>
70     <refsection role="see also">
71         <title>See also</title>
72         <simplelist type="inline">
73             <member>
74                 <link linkend="jautoTranspose">jautoTranspose</link>
75             </member>
76             <member>
77                 <link linkend="jwrapinfloat">jwrapinfloat</link>
78             </member>
79             <member>
80                 <link linkend="jwrapinchar">jwrapinchar</link>
81             </member>
82             <member>
83                 <link linkend="junwrap">junwrap</link>
84             </member>
85         </simplelist>
86     </refsection>
87     <refsection>
88         <title>History</title>
89         <revhistory>
90             <revision>
91                 <revnumber>5.5.0</revnumber>
92                 <revremark>
93                     Function introduced. Based on the 'JIMS' module. The main difference in the behavior compared to the JIMS module is that <link linkend="jautoUnwrap">jautoUnwrap</link> is enabled by default.
94                 </revremark>
95             </revision>
96         </revhistory>
97     </refsection>
98 </refentry>
99