MATLAB BUILDER JA 2 Podręcznik Użytkownika Strona 273

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 272
Programming Interfaces Generated by Java Builder
mlx API
For a function wi
th the following structure:
function [Out1, Out2, ..., varargout] =
foo(In1, In2, ..., InN, varargin)
Java Builder g enerates the following API, as the mlx interface:
public void foo (List outputs, List inputs) throws MWException;
public void foo (Object[] outputs, Object[] inputs) throws MWException;
Code Fragment: Signatures Generated for myprimes
Example
For a specific example, look at the myprimes method. This metho d has one
input argument, s o Java Builder generat es three overloaded methods in Java.
When you add
myprimes to the class myclass and build the component, Java
Builder generates the
myclass.java file. A fragment of myclass.java is
listed to show the three overloaded implementations of the
myprimes method
intheJavacode. Thefirstimplementationshowstheinterfacetobeusedif
there are no input arguments, the second shows the implementation to be
used if there is one input argument, and the third shows the feval interface.
/* mlx interface List version */
public void myprimes(List lhs, List rhs) throws MWException
{
(implementation omitted)
}
/* mlx interface Array version */
public void myprimes(Object[] lhs, Object[] rhs) throws MWException
{
(implementation omitted)
}
/* Standard interface no inputs*/
public Object[] myprimes(int nargout) throws MWException
{
(implementation omitted)
}
/* Standard interface one input*/
public Object[] myprimes(int nargout, Object n) throws MWException
6-17
Przeglądanie stron 272
1 2 ... 268 269 270 271 272 273 274 275 276 277 278 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag