See: Description
| Class | Description |
|---|---|
| MWArray |
The
MWArray class is the base class for native struct and cell
MATLAB array types. |
| MWCellArray |
The
MWCellArray class manages a native MATLAB cell array. |
| MWStructArray |
The
MWStructArray class manages a native MATLAB struct array. |
This package provides classes that represent MATLAB struct and cell array datatypes. The names of classes in this package are same as the ones in com.mathworks.toolbox.javabuilder package.
The main difference between this package and com.mathworks.toolbox.javabuilder package is that classes in this package do not need MCR. In terms of public API, these classes offer a subset of methods offered by their counterparts in com.mathworks.toolbox.javabuilder package. Classes in this package do not have methods that depend on MCR.
The struct and cell array classes in this package can be referred to as native struct and cell arrays.
Note: This package is meant to be used only with MATLAB Builder JA component that is being used in a JAVA RMI based application and where the client machine does not have MCR installed. This is also meant to be used for only those M function calls which have either struct or cell array as inputs or outputs. This package should not be used with standalone applications.
The users of, MATLAB Builder JA components with RMI, have a control over how the server sends the results of M function calls back to the client. The server can be set to marshal the output to the client as a com.mathworks.toolbox.javabuilder.MWArray subtype or as a JAVA native data type. Since the com.mathworks.toolbox.javabuilder.MWArray class hierarchy can be used only in presence of an MCR, the availability of MCR on the client machine decides how the server should be set for marshaling M function results. If the client machine does not have MCR, the server should be set to marshal the results as native types. When this is done, server returns the output of toArray() method of com.mathworks.toolbox.javabuilder.MWArray subtypes
The native data type representations of com.mathworks.toolbox.javabuilder.MWArray subtypes (output of toArray() method) corresponding to logical, numeric and string MATLAB data types are easier to deal with. For struct and cell arrays, which are specific to MATLAB, there is no direct representation available in JAVA. As a result when an instance of MWStructArray or MWCellArray is converted to JAVA native type using the toArray() method, the users get a multi dimensional Object array which is hard to comprehend. MWStructArray and MWCellArray classes from this package provide the solution to this problem.
Now with com.mathworks.extern.java package, if the server is set to marshal the native types, it converts the MATLAB struct or cell into com.mathworks.extern.java.MWStructArray or com.mathworks.extern.java.MWCellArray respectively instead of returning the output of toArray() to the client.
© 1994-2008 The MathWorks, Inc. Terms of Use Patents Trademarks