Mercurial > hg > octave-lyh
annotate scripts/deprecated/java_invoke.m @ 17392:8c5878260636
doc: Fix typo in fieldnames docstring.
* scripts/general/fieldnames.m: Eliminate stray parenthesis in docstring.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 06 Sep 2013 08:35:59 -0700 |
parents | fe112e09d799 |
children |
rev | line source |
---|---|
15790
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
1 ## Copyright (C) 2007 Michael Goffioul |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
2 ## |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
3 ## This file is part of Octave. |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
4 ## |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
5 ## Octave is free software; you can redistribute it and/or modify it |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
6 ## under the terms of the GNU General Public License as published by |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
8 ## your option) any later version. |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
9 ## |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
10 ## Octave is distributed in the hope that it will be useful, but |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
13 ## General Public License for more details. |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
14 ## |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
15 ## You should have received a copy of the GNU General Public License |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
16 ## along with Octave; see the file COPYING. If not, see |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
18 |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
19 ## -*- texinfo -*- |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
20 ## @deftypefn {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname}) |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
21 ## @deftypefnx {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname}, @var{arg1}, @dots{}) |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
22 ## Invoke the method @var{methodname} on the Java object @var{obj} with the |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
23 ## arguments @var{arg1}, @dots{} For static methods, @var{obj} can be a |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
24 ## string representing the fully qualified name of the corresponding class. |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
25 ## The function returns the result of the method invocation. |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
26 ## |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
27 ## When @var{obj} is a regular Java object, structure-like indexing can be |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
28 ## used as a shortcut syntax. For instance, the two following statements are |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
29 ## equivalent |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
30 ## |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
31 ## @example |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
32 ## @group |
16346
fe112e09d799
doc: Replace \" with " in deprecated java m-files copied from C++ sources.
Rik <rik@octave.org>
parents:
15794
diff
changeset
|
33 ## ret = java_invoke (x, "method1", 1.0, "a string") |
fe112e09d799
doc: Replace \" with " in deprecated java m-files copied from C++ sources.
Rik <rik@octave.org>
parents:
15794
diff
changeset
|
34 ## ret = x.method1 (1.0, "a string") |
15790
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
35 ## @end group |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
36 ## @end example |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
37 ## |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
38 ## @seealso{javaMethod, javaObject} |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
39 ## @end deftypefn |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
40 |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
41 function retval = java_invoke (obj, methodname, varargin) |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
42 |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
43 persistent warned = false; |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
44 if (! warned) |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
45 warned = true; |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
46 warning ("Octave:deprecated-function", |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
47 "java_invoke is obsolete and will be removed from a future version of Octave, please use javaMethod instead"); |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
48 endif |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
49 |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
50 if (nargin < 2) |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
51 print_usage (); |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
52 endif |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
53 |
15794
cf3bb2f353a5
java_new, java_invoke: convey cs-list rather than cell array
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
15790
diff
changeset
|
54 retval = javaMethod (methodname, obj, varargin{:}); |
15790
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
55 |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
56 endfunction |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
57 |