Mercurial > hg > octave-lyh
comparison libinterp/octave-value/ov-java.cc @ 15806:01d4f742d75d
doc: Re-organize and improve Java Interface documentation.
* doc/interpreter/java.txi: Add usejava, isjava functions, debug_java,
java_matrix_autoconversion, java_unsigned_autoconversion to docs.
Re-organize to put functions in logical order. Add new "Dialog Box Functions"
node.
* doc/interpreter/system.txi: Remove usejava from list of system functions.
* libinterp/octave-value/ov-java.cc(FjavaObject, FjavaMethod,
Fjava_unsigned_autoconversion): Improve docstrings.
* scripts/java/javaArray.m: Tweak docstring.
* scripts/java/listdlg.m: Wrap long lines in docstring. Improve
code example in docstring.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 17 Dec 2012 10:23:43 -0800 |
parents | d9b8333df5e4 |
children | 10d6ab9b1b4f |
comparison
equal
deleted
inserted
replaced
15805:420b5603cbbf | 15806:01d4f742d75d |
---|---|
1877 } | 1877 } |
1878 | 1878 |
1879 return retval; | 1879 return retval; |
1880 } | 1880 } |
1881 | 1881 |
1882 #endif | 1882 #endif // endif on HAVE_JAVA |
1883 // endif on HAVE_JAVA | 1883 |
1884 // | |
1885 // DEFUN blocks below must be outside of HAVE_JAVA block so that | 1884 // DEFUN blocks below must be outside of HAVE_JAVA block so that |
1886 // documentation strings are always available, even when functions are not. | 1885 // documentation strings are always available, even when functions are not. |
1887 | 1886 |
1888 DEFUN (javaObject, args, , | 1887 DEFUN (javaObject, args, , |
1889 "-*- texinfo -*-\n\ | 1888 "-*- texinfo -*-\n\ |
1890 @deftypefn {Built-in Function} {@var{jobj} =} javaObject (@var{classname})\n\ | 1889 @deftypefn {Built-in Function} {@var{jobj} =} javaObject (@var{classname})\n\ |
1891 @deftypefnx {Built-in Function} {@var{jobj} =} javaObject (@var{classname}, @var{arg1}, @dots{})\n\ | 1890 @deftypefnx {Built-in Function} {@var{jobj} =} javaObject (@var{classname}, @var{arg1}, @dots{})\n\ |
1892 Create a Java object of class @var{classsname}, by calling the class\n\ | 1891 Create a Java object of class @var{classsname}, by calling the class\n\ |
1893 constructor with the arguments @var{arg1}, @dots{}\n\ | 1892 constructor with the arguments @var{arg1}, @dots{}\n\ |
1894 \n\ | 1893 \n\ |
1895 The first example creates an uninitialized object,\n\ | 1894 The first example below creates an uninitialized object,\n\ |
1896 while the second example supplies an initial argument to the constructor.\n\ | 1895 while the second example supplies an initial argument to the constructor.\n\ |
1897 \n\ | 1896 \n\ |
1898 @example\n\ | 1897 @example\n\ |
1899 @group\n\ | 1898 @group\n\ |
1900 x = javaObject (\"java.lang.StringBuffer\")\n\ | 1899 x = javaObject (\"java.lang.StringBuffer\")\n\ |
1940 | 1939 |
1941 DEFUN (javaMethod, args, , | 1940 DEFUN (javaMethod, args, , |
1942 "-*- texinfo -*-\n\ | 1941 "-*- texinfo -*-\n\ |
1943 @deftypefn {Built-in Function} {@var{ret} =} javaMethod (@var{methodname}, @var{obj})\n\ | 1942 @deftypefn {Built-in Function} {@var{ret} =} javaMethod (@var{methodname}, @var{obj})\n\ |
1944 @deftypefnx {Built-in Function} {@var{ret} =} javaMethod (@var{methodname}, @var{obj}, @var{arg1}, @dots{})\n\ | 1943 @deftypefnx {Built-in Function} {@var{ret} =} javaMethod (@var{methodname}, @var{obj}, @var{arg1}, @dots{})\n\ |
1945 Invoke the method @var{methodname} on the Java object @var{obj} with the arguments\n\ | 1944 Invoke the method @var{methodname} on the Java object @var{obj} with the\n\ |
1946 @var{arg1}, @dots{} For static methods, @var{obj} can be a string\n\ | 1945 arguments @var{arg1}, @dots{} For static methods, @var{obj} can be a string\n\ |
1947 representing the fully qualified name of the corresponding class. The\n\ | 1946 representing the fully qualified name of the corresponding class. The\n\ |
1948 function returns the result of the method invocation.\n\ | 1947 function returns the result of the method invocation.\n\ |
1949 \n\ | 1948 \n\ |
1950 When @var{obj} is a regular Java object, structure-like indexing can be\n\ | 1949 When @var{obj} is a regular Java object, structure-like indexing can be\n\ |
1951 used as a shortcut syntax. For instance, the two following statements are\n\ | 1950 used as a shortcut syntax. For instance, the two following statements are\n\ |
2192 "-*- texinfo -*-\n\ | 2191 "-*- texinfo -*-\n\ |
2193 @deftypefn {Built-in Function} {@var{val} =} java_unsigned_autoconversion ()\n\ | 2192 @deftypefn {Built-in Function} {@var{val} =} java_unsigned_autoconversion ()\n\ |
2194 @deftypefnx {Built-in Function} {@var{old_val} =} java_unsigned_autoconversion (@var{new_val})\n\ | 2193 @deftypefnx {Built-in Function} {@var{old_val} =} java_unsigned_autoconversion (@var{new_val})\n\ |
2195 @deftypefnx {Built-in Function} {} java_unsigned_autoconversion (@var{new_val}, \"local\")\n\ | 2194 @deftypefnx {Built-in Function} {} java_unsigned_autoconversion (@var{new_val}, \"local\")\n\ |
2196 Query or set the internal variable that controls how integer classes are\n\ | 2195 Query or set the internal variable that controls how integer classes are\n\ |
2197 converted when Java matrix autoconversion is enabled. When enabled, Java\n\ | 2196 converted when @code{java_matrix_autoconversion} is enabled. When enabled,\n\ |
2198 arrays of class Byte or Integer are converted to matrices of class uint8 or\n\ | 2197 Java arrays of class Byte or Integer are converted to matrices of class\n\ |
2199 uint32 respectively.\n\ | 2198 uint8 or uint32 respectively. The default value is true.\n\ |
2200 \n\ | 2199 \n\ |
2201 When called from inside a function with the \"local\" option, the variable is\n\ | 2200 When called from inside a function with the \"local\" option, the variable is\n\ |
2202 changed locally for the function and any subroutines it calls. The original\n\ | 2201 changed locally for the function and any subroutines it calls. The original\n\ |
2203 variable value is restored when exiting the function.\n\ | 2202 variable value is restored when exiting the function.\n\ |
2204 @seealso{java_matrix_autoconversion, debug_java}\n\ | 2203 @seealso{java_matrix_autoconversion, debug_java}\n\ |
2234 return octave_value (); | 2233 return octave_value (); |
2235 #endif | 2234 #endif |
2236 } | 2235 } |
2237 | 2236 |
2238 // Outside of #ifdef HAVE_JAVA because it is desirable to be able to | 2237 // Outside of #ifdef HAVE_JAVA because it is desirable to be able to |
2239 // merely test for the presence of a Java object without having Java installed. | 2238 // test for the presence of a Java object without having Java installed. |
2240 DEFUN (isjava, args, , | 2239 DEFUN (isjava, args, , |
2241 "-*- texinfo -*-\n\ | 2240 "-*- texinfo -*-\n\ |
2242 @deftypefn {Built-in Function} {} isjava (@var{x})\n\ | 2241 @deftypefn {Built-in Function} {} isjava (@var{x})\n\ |
2243 Return true if @var{x} is a Java object.\n\ | 2242 Return true if @var{x} is a Java object.\n\ |
2244 @seealso{class, typeinfo, isa, javaObject}\n\ | 2243 @seealso{class, typeinfo, isa, javaObject}\n\ |