comparison scripts/java/javafields.m @ 15748:54e8c2527a9e

style and doc fixes for newly imported Java package .m files * java/cell2mlstr.m, java/errordlg.m, java/helpdlg.m, java/inputdlg.m, java/javaArray.m, java/javaaddpath.m, java/javaclasspath.m, java/javafields.m, java/javamem.m, java/javamethods.m, java/javarmpath.m, java/listdlg.m, java/msgbox.m java/questdlg.m, java/warndlg.m: Style and doc fixes.
author John W. Eaton <jwe@octave.org>
date Fri, 07 Dec 2012 17:21:27 -0500
parents da26f72408a7
children 0f1a143e5002
comparison
equal deleted inserted replaced
15747:4be890c5527c 15748:54e8c2527a9e
15 ## You should have received a copy of the GNU General Public License 15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see 16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>. 17 ## <http://www.gnu.org/licenses/>.
18 18
19 ## -*- texinfo -*- 19 ## -*- texinfo -*-
20 ## @deftypefn {Function file} {@var{P} =} javafields (@var{class}) 20 ## @deftypefn {Function file} {@var{p} =} javafields (@var{class})
21 ## 21 ## Return the fields of a Java object in the form of a cell
22 ## Returns the fields of a Java object in the form of a cell 22 ## array of strings. If no output is requested, print the result
23 ## array of strings. If no output variable is 23 ## printed on the standard output.
24 ## given, the result is simply printed on the standard output. 24 ## @seealso{javamethods}
25 ##
26 ## @end deftypefn 25 ## @end deftypefn
27 ## @seealso{javamethods}
28 26
29 function varargout = javafields(classname) 27 function retval = javafields (classname)
30 28
31 if (nargin != 1) 29 if (nargin != 1)
32 print_usage (); 30 print_usage ();
33 else 31 else
34 c_methods = java_invoke ("org.octave.ClassHelper", "getFields",classname); 32 c_methods = java_invoke ("org.octave.ClassHelper", "getFields", classname);
35 method_list = strsplit (c_methods, ';'); 33 method_list = strsplit (c_methods, ';');
36 34
37 switch nargout 35 switch (nargout)
38 case 0 36 case 0
39 if (! isempty (method_list)) 37 if (! isempty (method_list))
40 disp(method_list); 38 disp (method_list);
41 endif 39 endif
42 case 1 40
43 varargout{1} = cellstr (method_list); 41 case 1
44 endswitch 42 retval = cellstr (method_list);
45 endif 43 endswitch
44 endif
46 45
47 endfunction 46 endfunction