annotate scripts/deprecated/java_invoke.m @ 19628:fe689210525c gui-release

maint: Periodic merge of stable to gui-release.
author John W. Eaton <jwe@octave.org>
date Tue, 20 Jan 2015 10:05:42 -0500
parents e124ae274013 446c46af4b42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 16346
diff changeset
1 ## Copyright (C) 2007, 2013 Michael Goffioul
15790
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
19627
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
24 ## string representing the fully qualified name of the corresponding class.
15790
921912c92102 Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff changeset
25 ## The function returns the result of the method invocation.
19627
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
26 ##
15790
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
19627
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
30 ##
15790
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
19627
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
37 ##
15790
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
19627
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
49
15790
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