comparison 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
comparison
equal deleted inserted replaced
19624:6d75f1683ce8 19628:fe689210525c
19 ## -*- texinfo -*- 19 ## -*- texinfo -*-
20 ## @deftypefn {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname}) 20 ## @deftypefn {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname})
21 ## @deftypefnx {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname}, @var{arg1}, @dots{}) 21 ## @deftypefnx {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname}, @var{arg1}, @dots{})
22 ## Invoke the method @var{methodname} on the Java object @var{obj} with the 22 ## Invoke the method @var{methodname} on the Java object @var{obj} with the
23 ## arguments @var{arg1}, @dots{} For static methods, @var{obj} can be a 23 ## arguments @var{arg1}, @dots{} For static methods, @var{obj} can be a
24 ## string representing the fully qualified name of the corresponding class. 24 ## string representing the fully qualified name of the corresponding class.
25 ## The function returns the result of the method invocation. 25 ## The function returns the result of the method invocation.
26 ## 26 ##
27 ## When @var{obj} is a regular Java object, structure-like indexing can be 27 ## When @var{obj} is a regular Java object, structure-like indexing can be
28 ## used as a shortcut syntax. For instance, the two following statements are 28 ## used as a shortcut syntax. For instance, the two following statements are
29 ## equivalent 29 ## equivalent
30 ## 30 ##
31 ## @example 31 ## @example
32 ## @group 32 ## @group
33 ## ret = java_invoke (x, "method1", 1.0, "a string") 33 ## ret = java_invoke (x, "method1", 1.0, "a string")
34 ## ret = x.method1 (1.0, "a string") 34 ## ret = x.method1 (1.0, "a string")
35 ## @end group 35 ## @end group
36 ## @end example 36 ## @end example
37 ## 37 ##
38 ## @seealso{javaMethod, javaObject} 38 ## @seealso{javaMethod, javaObject}
39 ## @end deftypefn 39 ## @end deftypefn
40 40
41 function retval = java_invoke (obj, methodname, varargin) 41 function retval = java_invoke (obj, methodname, varargin)
42 42
44 if (! warned) 44 if (! warned)
45 warned = true; 45 warned = true;
46 warning ("Octave:deprecated-function", 46 warning ("Octave:deprecated-function",
47 "java_invoke is obsolete and will be removed from a future version of Octave, please use javaMethod instead"); 47 "java_invoke is obsolete and will be removed from a future version of Octave, please use javaMethod instead");
48 endif 48 endif
49 49
50 if (nargin < 2) 50 if (nargin < 2)
51 print_usage (); 51 print_usage ();
52 endif 52 endif
53 53
54 retval = javaMethod (methodname, obj, varargin{:}); 54 retval = javaMethod (methodname, obj, varargin{:});