<?xml version="1.0" encoding="UTF-8"?>
<!--
*
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2010 - 2011 - Calixte DENIZET <calixte@contrib.scilab.org>
*
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
*
*
-->
<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="jarray">
    <refnamediv>
        <refname>jarray</refname>
        <refpurpose>Create a Java array</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>
            jarray(className, n_1 [, n_2 [, ...]])
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Parameters</title>
        <variablelist>
            <varlistentry>
                <term>className</term>
                <listitem>
                    <para>A string giving the class name</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>n_i</term>
                <listitem>
                    <para>An integer giving the array dimension</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            Creates a multidimensional array n_1x...xn_p of elements with type className. An array element can be accessed in using classical Scilab notations, the indexing follows Scilab convention: it start at 1.
        </para>
        <para>
            The className can be one of the primitive datatypes: double, int, boolean, short, long, float, char and byte.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
               a = jarray("java.lang.String", 2, 2, 3);
               // array insertion
               a(1, 1, 3) = "Hi Jims !";
               a(2, 1, 3) = "Hi Jims again !!"

               // array extraction
               length(a(2, 1, 3));
               a(2, 1, 3)
      ]]></programlisting>
    </refsection>
    <refsection>
        <title>History</title>
        <revhistory>
            <revision>
                <revnumber>5.5.0</revnumber>
                <revremark>
                    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.
                </revremark>
            </revision>
        </revhistory>
    </refsection>
</refentry>

