Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.1 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Java from Scilab > jsetfield

jsetfield

Javaオブジェクトのフィールドを設定

呼び出し手順

jsetfield(object, fieldName, value)

パラメータ

object

_JObjまたは_JClass型のmlistまたはScilab変数の

fieldName

フィールド名を指定する文字列

value

Scilab変数または_JObj型のmlistで, 新しいフィールの値

説明

fieldNameという名前のフィールドに指定した値を設定します.

この関数は,公開javaフィールドにマップされない beansプロパティについても動作します.

c = jcompile("Test", ["public class Test {";
                      "public int field;";
                      "public Test(int n) {";
                      "field = n;";
                      "}";
                      "}";]);
t = c.new(128);
t.field
jsetfield(t, "field", 256);
t.field

// But it is easier to use...
t.field = 512;
t.field
jremove c t;
jimport java.util.Date;

d = Date.new();
d.minutes = 3; // will call d.setMinutes(3);
jsetfield(d, "minutes", 3); // will call d.setMinutes(3);

jremove Date d;

参照

  • jgetfield — Javaオブジェクトのフィールドの値を取得

履歴

VersionDescription
5.5.0 関数が導入されました. 'JIMS'モジュールに基づきます. JIMSモジュールとの動作上の主な違いは, jautoUnwrapがデフォルトで 有効になっていることです.
Report an issue
<< jremove Java from Scilab junwrap >>

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 Feb 12 23:12:44 CET 2018