com.maplesoft.client
Class MapleToMathML

java.lang.Object
  |
  +--com.maplesoft.client.MapleStatement
        |
        +--com.maplesoft.client.MapleToMathML

public class MapleToMathML
extends MapleStatement

Convert a Maple command into the equivalent MathML representation. It extends the basic capabilities of the MapleStatement and can return either the CONTENT or PRESENTATION or both formats of the MathML expression.


Field Summary
static int CONTENT
          Compute MathML to contain CONTENT form
static int PARALLEL
          Compute MathML to contain both CONTENT and PRESENTATION forms
static int PRESENTATION
          Compute MathML to contain PRESENTATION form
 
Constructor Summary
MapleToMathML(HostInfo hostinfo, UserInfo userinfo)
          Constructor
MapleToMathML(java.lang.String sHost, int iPort, java.lang.String sUser, java.lang.String sPassword)
          Constructor
 
Method Summary
 java.lang.String execute(java.lang.String sMaple)
          Sends the maple command to the server to be converted to its MathML representation.
 java.lang.String[] execute(java.lang.String[] saMaple)
          Pass the sequence of commands contained in the string array to the Maple Server.
 java.lang.String[] execute(java.lang.String[] saMaple, int iType)
          Sends the maple command sequence to the server to be converted to its MathML representation.
 java.lang.String execute(java.lang.String sMaple, int iType)
          Sends the maple command to the server to be converted to its MathML representation.
 java.lang.String getResult()
          Returns the MathML representation of the Maple command.
 java.lang.String[] getResultArray()
          Returns the MathML representation of the Maple command.
 
Methods inherited from class com.maplesoft.client.MapleStatement
doMaple, getHost, getLock, getResponse, getResponseArray, getUser, getXMLString, getXMLStringArray, releaseLock, setHost, setHost, setUser, setUser
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARALLEL

public static final int PARALLEL
Compute MathML to contain both CONTENT and PRESENTATION forms
See Also:
execute(String, int)

CONTENT

public static final int CONTENT
Compute MathML to contain CONTENT form
See Also:
execute(String, int)

PRESENTATION

public static final int PRESENTATION
Compute MathML to contain PRESENTATION form
See Also:
execute(String, int)
Constructor Detail

MapleToMathML

public MapleToMathML(java.lang.String sHost,
                     int iPort,
                     java.lang.String sUser,
                     java.lang.String sPassword)
Constructor
Parameters:
sHost - - host name of server
iPort - - specific port for server
sUser - - username as registered at server
sPassword - - password for user

MapleToMathML

public MapleToMathML(HostInfo hostinfo,
                     UserInfo userinfo)
Constructor
Parameters:
hostinfo - - Host information object
userinfo - - User information object
See Also:
HostInfo, UserInfo
Method Detail

execute

public java.lang.String execute(java.lang.String sMaple)
                         throws MapleStatementException,
                                MapleException
Sends the maple command to the server to be converted to its MathML representation. The result is obtained via the getResult method with the MathML containing both forms CONTENT and PRESENTATION.
Overrides:
execute in class MapleStatement
Parameters:
sMaple - - a string representing the Maple Command
Returns:
a string representing the answer from the server
Throws:
MapleException - if it cannot connect to server, if the user is invalid or if the host is unknown.
MapleStatementException - if it cannot the request cannot be processed by the server
See Also:
MapleStatement.execute( String ), getResult()

execute

public java.lang.String[] execute(java.lang.String[] saMaple)
                           throws MapleStatementException,
                                  MapleException
Description copied from class: MapleStatement
Pass the sequence of commands contained in the string array to the Maple Server.
 Note: Valid Host and User information needs to be set before
       calling this method, either through the constructor
       MapleStatement or through the
       setHost and setUser methods.
 
Overrides:
execute in class MapleStatement
Parameters:
saMaple - - a string array representing the sequence of Maple Commands
Returns:
a String array representing the answer from the server
Throws:
MapleException - if it cannot connect to server, if the user is invalid or if the host is unknown.
MapleStatementException - if it cannot the request cannot be processed by the server
See Also:
MapleStatement.execute( String[] ), getResult()

execute

public java.lang.String execute(java.lang.String sMaple,
                                int iType)
                         throws MapleStatementException,
                                MapleException
Sends the maple command to the server to be converted to its MathML representation. The result is obtained via the getResult method with the MathML containing both forms CONTENT and PRESENTATION.
Parameters:
sMaple - - a string representing the Maple Command
iType - - specify one of PARALLEL, CONTENT or PRESENTATION
Returns:
a string representing the answer from the server
Throws:
MapleException - if it cannot connect to server, if the user is invalid or if the host is unknown.
MapleStatementException - if it cannot the request cannot be processed by the server
See Also:
MapleStatement.execute( String ), getResult()

execute

public java.lang.String[] execute(java.lang.String[] saMaple,
                                  int iType)
                           throws MapleStatementException,
                                  MapleException
Sends the maple command sequence to the server to be converted to its MathML representation. The result is obtained via the getResult method with the MathML containing both forms CONTENT and PRESENTATION.
Parameters:
sMaple - - a string representing the Maple Command
iType - - specify one of PARALLEL, CONTENT or PRESENTATION
Returns:
a string array representing the answer from the server
Throws:
MapleException - if it cannot connect to server, if the user is invalid or if the host is unknown.
MapleStatementException - if it cannot the request cannot be processed by the server
See Also:
MapleStatement.execute( String[] ), getResult()

getResult

public java.lang.String getResult()
Returns the MathML representation of the Maple command.
Returns:
A string representing the MathML for the last execute() invocation.

getResultArray

public java.lang.String[] getResultArray()
Returns the MathML representation of the Maple command.
Returns:
A string representing the MathML for the last execute() invocation.