Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
Object - クラスの新規インスタンスを作成
使い方
Object( obj )
Object( obj, arg1, ... )
パラメータ
obj
-
オブジェクトのインスタンス
arg1, ...
ModuleCopy ルーチンの引数
Object ルーチンは、与えられたオブジェクトをコピーして新規の object を作成します。
新規オブジェクトの宣言に関する詳細は、Object,create を参照してください。Maple におけるオブジェクトの概要については、object を参照してください。
与えられたオブジェクトが ModuleCopy ルーチンを実装していない場合、Object はオブジェクト obj の static でないメンバーの値を新規オブジェクトにコピーします。
オブジェクトが ModuleCopy ルーチンを実装している場合は、Object を呼び出すと ModuleCopy ルーチンを実行します。追加パラメータ (arg1, ...) も ModuleCopy ルーチンに渡されます。
ModuleCopy を実行する Object を呼び出す ModuleApply ルーチンを実装し、オブジェクトにプロトタイプオブジェクトを適用します。
互換性
Object コマンドは Maple 16 で導入されました。
Maple 16 における変更点についての詳細は、Maple 16 の新機能 を参照してください。
例
module Obj() option object; local data := 0; export getData::static := proc( self::Obj ) self:-data; end; export setData::static := proc( self::Obj, d ) self:-data := d; end; end:
getData( Obj );
newObj1 := Object( Obj );
getData( newObj1 );
setData( newObj1, 10 );
newObj2 := Object( newObj1 );
getData( newObj2 );
module Obj2() option object; local data := 0; export getData::static := proc( self::Obj2 ) self:-data; end; export ModuleCopy::static := proc( self::Obj2, proto::Obj2, d, $ ) if ( _npassed = 2 ) then self:-data := proto:-data; else self:-data := d; end; end; end:
getData( Obj2 );
newObj1 := Object( Obj2 );
newObj2 := Object( Obj2, 10 );
module Obj3() option object; local data := 0; export getData::static := proc( self::Obj3 ) self:-data; end; export ModuleApply::static := proc( ) Object( Obj3, _passed ); end; export ModuleCopy::static := proc( self::Obj3, proto::Obj3, d, $ ) if ( _npassed = 2 ) then self:-data := proto:-data; else self:-data := d; end; end; end:
newObj1 := Obj3( );
newObj2 := Obj3( 10 );
関連項目
ModuleApply、ModuleCopy、object、Object,builtin、Object,create、Object,method、Object,operators、procedure
Download Help Document