Update of the documentation
[scilab.git] / scilab / modules / external_objects_java / help / en_US / jcast.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 *
4 * JIMS ( http://forge.scilab.org/index.php/p/JIMS/ ) - This file is a part of JIMS
5 * Copyright (C) 2010 - 2011 - Calixte DENIZET <calixte@contrib.scilab.org>
6 *
7 * This file must be used under the terms of the CeCILL.
8 * This source file is licensed as described in the file COPYING, which
9 * you should have received as part of this distribution.  The terms
10 * are also available at
11 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
12 *
13 *
14 -->
15 <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">
16     <refnamediv>
17         <refname>jcast</refname>
18         <refpurpose>Cast a Java object into another one.</refpurpose>
19     </refnamediv>
20     <refsynopsisdiv>
21         <title>Calling Sequence</title>
22         <synopsis>
23             jcast(javaObject, class)
24         </synopsis>
25     </refsynopsisdiv>
26     <refsection>
27         <title>Parameters</title>
28         <variablelist>
29             <varlistentry>
30                 <term>javaObject</term>
31                 <listitem>
32                     <para>A mlist typed _JObj</para>
33                 </listitem>
34             </varlistentry>
35             <varlistentry>
36                 <term>class</term>
37                 <listitem>
38                     <para>A string giving the class name or a mlist typed _JClass got with jimport or jcompile</para>
39                 </listitem>
40             </varlistentry>
41         </variablelist>
42     </refsection>
43     <refsection>
44         <title>Description</title>
45         <para>
46             Cast an object into another one with the given class if it is possible.
47         </para>
48     </refsection>
49     <refsection>
50         <title>Examples</title>
51         <programlisting role="example"><![CDATA[
52                jimport java.lang.Double;
53                jimport java.lang.Number;
54
55                d = Double.new("1.23456");
56                jgetclassname(d)
57                e = jcast(d, "java.lang.Number");
58                // or as an alternative
59                f = jcast(d, Number);
60                jgetclassname(e)
61                jremove e d f;
62       ]]></programlisting>
63     </refsection>
64     <refsection role="see also">
65         <title>See Also</title>
66         <simplelist type="inline">
67             <member>
68                 <link linkend="jgetclassname">jgetclassname</link>
69             </member>
70         </simplelist>
71     </refsection>
72 </refentry>