Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2023.0.0 - English


jcast

Cast a Java object into another one.

Syntax

jcast(javaObject, class)

Parameters

javaObject

A mlist typed _JObj

class

A string giving the class name or a mlist typed _JClass got with jimport or jcompile

Description

Cast an object into another one with the given class if it is possible.

Examples

jimport java.lang.Double;
jimport java.lang.Number;

d = Double.new("1.23456");
jgetclassname(d)
e = jcast(d, "java.lang.Number");
// or as an alternative
f = jcast(d, Number);
jgetclassname(e)
jremove e d f;

See also

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
<< jautoUnwrap Java from Scilab jcompile >>

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:
Mon Mar 27 11:52:51 GMT 2023