Mercurial > hg > octave-lyh
annotate scripts/deprecated/java_invoke.m @ 16724:b7667fcb9fbc
Substitute ostrsplit() for strsplit().
The function ostrsplit() is Octave's original strsplit(), and strsplit()
has been modified to be compatible with Matlab's version. Bug #39010.
* scripts/deprecated/javafields.m: Change call to ostrsplit().
* scripts/deprecated/javamethods.m: ditto
* scripts/general/fieldnames.m: ditto
* scripts/general/int2str.m: ditto
* scripts/general/methods.m: ditto
* scripts/general/num2str.m: ditto
* scripts/help/gen_doc_cache.m: ditto
* scripts/help/help.m: ditto
* scripts/help/lookfor.m: ditto
* scripts/io/strread.m: ditto
* scripts/java/javaclasspath.m: ditto
* scripts/miscellaneous/compare_versions.m: ditto
* scripts/miscellaneous/computer.m: ditto
* scripts/miscellaneous/fact.m: ditto
* scripts/miscellaneous/tar.m: ditto
* scripts/miscellaneous/unpack.m: ditto
* scripts/miscellaneous/what.m: ditto
* scripts/miscellaneous/zip.m: ditto
* scripts/pkg/private/configure_make.m: ditto
* scripts/pkg/private/fix_depends.m: ditto
* scripts/pkg/private/generate_lookfor_cache.m: ditto
* scripts/pkg/private/list_forge_packages.m: ditto
* scripts/pkg/private/unload_packages.m: ditto
* scripts/pkg/private/write_index.m: ditto
* scripts/plot/private/__file_filter__.m: ditto
* scripts/plot/private/__fltk_file_filter__.m: ditto
* scripts/plot/private/__go_draw_axes__.m: ditto
* scripts/plot/private/__next_line_style__.m: ditto
* scripts/testfun/rundemos.m: ditto
* scripts/testfun/runtests.m: ditto
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Thu, 06 Jun 2013 10:06:12 +0800 |
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 |