[doc] misc. fix & improvements
[scilab.git] / scilab / modules / external_objects_java / help / en_US / jcast.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="jcast">
19     <refnamediv>
20         <refname>jcast</refname>
21         <refpurpose>Cast a Java object into another one.</refpurpose>
22     </refnamediv>
23     <refsynopsisdiv>
24         <title>Syntax</title>
25         <synopsis>
26             jcast(javaObject, class)
27         </synopsis>
28     </refsynopsisdiv>
29     <refsection>
30         <title>Parameters</title>
31         <variablelist>
32             <varlistentry>
33                 <term>javaObject</term>
34                 <listitem>
35                     <para>A mlist typed _JObj</para>
36                 </listitem>
37             </varlistentry>
38             <varlistentry>
39                 <term>class</term>
40                 <listitem>
41                     <para>A string giving the class name or a mlist typed _JClass got with jimport or jcompile</para>
42                 </listitem>
43             </varlistentry>
44         </variablelist>
45     </refsection>
46     <refsection>
47         <title>Description</title>
48         <para>
49             Cast an object into another one with the given class if it is possible.
50         </para>
51     </refsection>
52     <refsection>
53         <title>Examples</title>
54         <programlisting role="example"><![CDATA[
55                jimport java.lang.Double;
56                jimport java.lang.Number;
57
58                d = Double.new("1.23456");
59                jgetclassname(d)
60                e = jcast(d, "java.lang.Number");
61                // or as an alternative
62                f = jcast(d, Number);
63                jgetclassname(e)
64                jremove e d f;
65       ]]></programlisting>
66     </refsection>
67     <refsection role="see also">
68         <title>See also</title>
69         <simplelist type="inline">
70             <member>
71                 <link linkend="jgetclassname">jgetclassname</link>
72             </member>
73         </simplelist>
74     </refsection>
75     <refsection>
76         <title>History</title>
77         <revhistory>
78             <revision>
79                 <revnumber>5.5.0</revnumber>
80                 <revremark>
81                     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.
82                 </revremark>
83             </revision>
84         </revhistory>
85     </refsection>
86 </refentry>
87