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
Java OpenMaple Application Program Interface (API)
Java OpenMaple provides an interface between the Maple evaluation engine and a Java program. This is implemented using Java classes and Java interfaces. The classes allow Java programs to access the Maple evaluation engine. The interfaces allow the Maple evaluation engine to call Java functions.
Overview
To use the Java Open Maple interface, start by creating an Engine object. The Engine constructor accepts an object that implements the EngineCallBacks interface. These call backs are used to handle various events from the Maple engine. The Engine object can be used to evaluate a string containing Maple commands or to create new Maple data structures. The Engine object is essentially an object factory for creating Java objects that represent Maple data.
The various Maple data types have corresponding Java classes. These objects have member functions to allow the programmer to manipulate them. Here are a few examples:
The Name object represents a Maple name. A value can be assigned to a Name by using the assign member function. To access the value assigned to the Name the eval member function can be called.
A Procedure object represents a Maple procedure. The execute member function can be used to call the procedure.
There is an hierarchy among the Open Maple objects. All the Open Maple objects inherit from the Algebraic{OpenMaple/Java/Algebraic} class. This provides the functions that are common to all Maple objects, such as eval. In addition, the classes Numeric and RTable are sub-classes of Algebraic and are themselves parent classes.
To handle errors Maple objects throw a MapleException. In additon, user specified call backs can throw a MapleException to indicate that an error occured.
Interfaces
The following interfaces allow Java functions to be called from the Maple evaluation engine.
Interface Listing
EngineCallBacks
HelpCallBacks
com.maplesoft.openmaple.HelpCallBacks
The HelpCallBacks interface provides the functionality required to access the text of a help page.
writeAttrib
writeChar
com.maplesoft.openmaple.EngineCallBacks
The EngineCallBacks interface provides the functionality required to transfer general information between the user and Maple evaluation engine, for example, interrupt handling and warning, error, and status messages.
callBackCallBack
errorCallBack
queryInterrupt
readlineCallBack
redirectCallBack
statusCallBack
streamCallBack
textCallBack
Classes
The following classes are available to interface with the Maple evaluation engine. To access these classes, the jopenmaple.jar and externalcall.jar files must be in the classpath. As well, the Java Open Maple native library must be accessible to the dynamic loader. For more information, see the running page.
Class Listing
Algebraic
AlgebraicRTable
ByteRTable
ComplexDoubleRTable
ComplexNumeric
ComplexNumericRTable
DoubleRTable
Engine
EngineCallBacksDefault
Expseq
FloatRTable
HelpCallBacksDefault
IntRTable
List
LongRTable
MString
Name
Numeric
NumericRTable
Procedure
RTable
ShortRTable
Table
com.maplesoft.openmaple.Engine
The Engine class is used to start, restart, and stop the Maple session as well as evaluate Maple statements and create new Maple data structures.
evaluate
getHelp
newExpseq
newList
newMString
newName
newNumeric
newTable
restart
stop
com.maplesoft.openmaple.Algebraic
The Algebraic class is the parent class of all the classes that represent Maple objects. Its member functions provide access to all the basic functions that can be performed on an object.
dagEquals
dispose
eval
evalhf
isDisposed
isNULL
isSet
isStop
toString
uneval
unique
com.maplesoft.openmaple.Numeric
The Numeric class represents numeric objects (integers and floats). The Numeric class has member functions to convert the Maple object to the Java native types.
byteValue
doubleValue
floatValue
intValue
isByte
isInt
isInteger
isLong
isShort
isUnnamedZero
longValue
shortValue
com.maplesoft.openmaple.ComplexNumeric
The ComplexNumeric class represents complex numbers. Conceptually, a ComplexNumeric object contains two Numeric objects: its real part and its imaginary part.
imaginaryPart
realPart
com.maplesoft.openmaple.Name
The Name class represents a Maple name. Name publicly inherits from Algebraic.
assign
isAssigned
com.maplesoft.openmaple.Expseq
The Expseq class represents an expression sequence. Member functions allow for indexing into the expression sequence and returning its length.
length
select
com.maplesoft.openmaple.List
The List class represents a list. Member functions allow for indexing into the list and returning its length.
com.maplesoft.openmaple.Procedure
The Procedure class represents a procedure. Member functions allow for evaluating the procedure.
execute
executehf
com.maplesoft.openmaple.Table
The Table class represents a table. Data can be inserted and removed from the table and a table can be searched for a particular element.
has
remove
com.maplesoft.openmaple.RTable
The RTable class represents an rtable. Datatype specific rtables are represented by sub-classes of RTable. These sub-classes have datatype specific functions. The RTable member functions perform operations applicable to any rtable.
copy
dimensions
lowerBound
numElements
upperBound
com.maplesoft.openmaple.AlgebraicRTable
The AlgebraicRTable class represents an rtable of type anything. It allows access to individual elements of the rtable as Algebraic objects.
com.maplesoft.openmaple.ByteRTable
The ByteRTable class represents an rtable of type . It allows access to individual elements of the rtable as Java bytes.
com.maplesoft.openmaple.ComplexDoubleRTable
The ComplexDoubleRTable class represents an rtable of type . It allows access to individual elements of the rtable as pairs of Java doubles.
copyImaginary
copyReal
selectImaginary
selectReal
com.maplesoft.openmaple.ComplexNumericRTable
The ComplexNumericRTable class represents an rtable of type . It allows access to individual elements of the rtable as ComplexNumeric objects.
com.maplesoft.openmaple.DoubleRTable
The DoubleRTable class represents an rtable of type . It allows access to individual elements of the rtable as Java doubles.
com.maplesoft.openmaple.FloatRTable
The FloatRTable class represents an rtable of type . It allows access to individual elements of the rtable as Java floats.
com.maplesoft.openmaple.IntRTable
The IntRTable class represents an rtable of type . It allows access to individual elements of the rtable as Java integers.
com.maplesoft.openmaple.LongRTable
The LongRTable class represents an rtable of type . It allows access to individual elements of the rtable as Java longs.
com.maplesoft.openmaple.NumericRTable
The NumericRTable class represents an rtable of type . It allows access to individual elements of the rtable as Numeric objects.
com.maplesoft.openmaple.ShortRTable
The ShortRTable class represents an rtable of type . It allows access to individual elements of the rtable as Numeric objects.
com.maplesoft.externalcall.MapleException
The MapleException class is used when errors are raised within Java Open Maple. See also the ?MapleException class constructor help page.
getArg
getArgCount
com.maplesoft.openmaple.HelpCallBacksDefault
The HelpCallBacksDefault provides a basic implementation of the HelpCallBacks interface. This class can be used directly or it can be sub-classed to override the member functions.
com.maplesoft.openmaple.EngineCallBacksDefault
The EngineCallBacksDefault provides a basic implementation of the EngineCallBacks interface. This class can be used directly or it can be sub-classed to override the member functions.
com.maplesoft.openmaple.MString
The MString represents a Maple string. This class provides conversion from Maple strings to Java strings.
stringValue
See Also
OpenMaple, OpenMaple/Java/Examples
Download Help Document