From: <mar...@us...> - 2011-06-27 11:52:31
|
Revision: 8358 http://octave.svn.sourceforge.net/octave/?rev=8358&view=rev Author: martinhepperle Date: 2011-06-27 11:52:23 +0000 (Mon, 27 Jun 2011) Log Message: ----------- Fixed a typo: changed 'Octave_VERSION' to uppercase in FAQ. Modified Paths: -------------- trunk/octave-forge/extra/java/inst/doc.info Modified: trunk/octave-forge/extra/java/inst/doc.info =================================================================== --- trunk/octave-forge/extra/java/inst/doc.info 2011-06-27 11:51:46 UTC (rev 8357) +++ trunk/octave-forge/extra/java/inst/doc.info 2011-06-27 11:52:23 UTC (rev 8358) @@ -1,84 +1,70 @@ -This is octave-java.info, produced by makeinfo version 4.11 from -octave-java.texi. +This is octave-java.info, produced by makeinfo version 4.11 from octave-java.texi. - - File: octave-java.info, Node: Top, Next: javaclasspath, Up: (dir) 1 Using Octave (and Matlab) with Java ************************************* - - - This description is based on the Octave package `java-1.2.8'. The +This description is based on the Octave package `java-1.2.8'. The `java' package usually installs its script files (.m) in the directory `.../share/Octave/packages/java-1.2.8' and its binary (.oct) files in -`.../libexec/Octave/packages/java-1.2.8'. - - You can get help on -specific functions in Octave by executing the help command - with the -name of a function from this package: - Octave > help javaObject - - You can view this help file in Octave by executing the info -command with - just the word java: - Octave > doc java - - +`.../libexec/Octave/packages/java-1.2.8'. + You can get help on specific functions in Octave by executing the +help command with the name of a function from this package: + Octave > help javaObject + + You can view this help file in Octave by executing the info command +with just the word java: + Octave > doc java + Note on calling Octave from Java ================================ -The `java' package is designed for calling Java from Octave. - If you -want to call Octave from Java, you might want to use a library like -`javaOctave' [http://kenai.com/projects/javaOctave] or - `joPas' -[http://jopas.sourceforge.net]. +The `java' package is designed for calling Java from Octave. If you +want to call Octave from Java, you might want to use a library like +`javaOctave' [http://kenai.com/projects/javaOctave] or `joPas' +[http://jopas.sourceforge.net]. 2 Table of Contents ******************* - - Available Functions +Available Functions * Menu: -* javaclasspath:: get the class path of the JVM -* javaaddpath:: add a path to the class path of the JVM -* javarmpath:: remove a path to the class path of the JVM -* javamem:: get information about available memory -* javaArray:: create a Java array -* javaObject:: create a Java object -* java_new:: create a Java object -* javaMethod:: invoke a method on the Java object -* java_invoke:: invoke a method on the Java object -* java_get:: get a field on the Java object -* java_set:: set a field on the Java object -* javamethods:: list the available methods of a Java objects -* javafields:: list the available fields of a Java objects -* msgbox:: display a dialog box -* errordlg:: display a dialog with an error symbol -* listdlg:: display a dialog with a selection list -* warndlg:: display a dialog with a warning symbol -* helpdlg:: display a dialog with a help symbol -* inputdlg:: display a dialog with edit fields -* questdlg:: display a dialog with a question icon +* javaclasspath:: get the class path of the JVM +* javaaddpath:: add a path to the class path of the JVM +* javarmpath:: remove a path to the class path of the JVM +* javamem:: get information about available memory +* javaArray:: create a Java array +* javaObject:: create a Java object +* java_new:: create a Java object +* javaMethod:: invoke a method on the Java object +* java_invoke:: invoke a method on the Java object +* java_get:: get a field on the Java object +* java_set:: set a field on the Java object +* javamethods:: list the available methods of a Java objects +* javafields:: list the available fields of a Java objects +* msgbox:: display a dialog box +* errordlg:: display a dialog with an error symbol +* listdlg:: display a dialog with a selection list +* warndlg:: display a dialog with a warning symbol +* helpdlg:: display a dialog with a help symbol +* inputdlg:: display a dialog with edit fields +* questdlg:: display a dialog with a question icon Frequently Asked Questions * Menu: -* How to distinguish between Octave and Matlab?:: -* How to make Java classes available?:: -* How to create an instance of a Java class?:: -* How can I handle memory limitations?:: -* How to compile the java package in Octave?:: -* Which TeX symbols are implemented in the dialog functions?:: - +* How to distinguish between Octave and Matlab?:: +* How to make Java classes available?:: +* How to create an instance of a Java class?:: +* How can I handle memory limitations?:: +* How to compile the java package in Octave?:: +* Which TeX symbols are implemented in the dialog functions?:: 3 Available Functions ********************* @@ -86,117 +72,96 @@ File: octave-java.info, Node: javaclasspath, Next: javaaddpath, Prev: Top, Up: Top - - 3.1 javaclasspath ================= - - -- Function file: javaclasspath -- Function file: STATIC = javaclasspath -- Function file: [STATIC, DYNAMIC] = javaclasspath -- Function file: PATH = javaclasspath (WHAT) - - Return the class path of the Java virtual machine as a cell - array of strings. - - If called without an input parameter: + Return the class path of the Java virtual machine as a cell array + of strings. + + If called without an input parameter: * If no output variable is given, the result is simply printed - - to the standard output. + to the standard output. - * If one output variable STATIC is given, the result is - the - static classpath. + * If one output variable STATIC is given, the result is the + static classpath. - * If two output variables STATIC and DYNAMIC are - given, the - first variable will contain the static classpath, - the - second will be filled with the dynamic claspath. - - If called with a single input parameter WHAT: - If no output parameter is given: + * If two output variables STATIC and DYNAMIC are given, the + first variable will contain the static classpath, the second + will be filled with the dynamic claspath. + If called with a single input parameter WHAT: + If no output parameter is given: + * The result is printed to the standard output similar to the call without input parameter. - - If the output parameter PATH is used: + If the output parameter PATH is used: - * If WHAT is '-static' the static classpath is returned. + * If WHAT is '-static' the static classpath is returned. - * If WHAT is '-dynamic' the dynamic classpath is returned. + * If WHAT is '-dynamic' the dynamic classpath is returned. - * If WHAT is '-all' the static and the dynamic classpath - are - returned in a single cell array. - - For the example two entries have been added to the static - classpath using the file `classpath.txt'. - - Example: - Octave > javaclasspath('-all') - STATIC JAVA PATH - - z:/someclasses.jar - z:/classdir/classfiles - - DYNAMIC JAVA PATH - - empty - - - Octave > javaaddpath('z:/dynamic'); - Octave > ps = javaclasspath('-all') - ps = - { - [1,1] = z:/someclasses.jar - [1,2] = z:/classdir/classfiles - [1,3] = z:/dynamic - } - + * If WHAT is '-all' the static and the dynamic classpath are + returned in a single cell array. - *See also:* *note javaaddpath: doc-javaaddpath, - *note - javarmpath: doc-javarmpath, - *note How to make Java - classes available to Octave?: doc-FAQ. - + For the example two entries have been added to the static + classpath using the file `classpath.txt'. + Example: + Octave > javaclasspath('-all') + STATIC JAVA PATH + + z:/someclasses.jar + z:/classdir/classfiles + + DYNAMIC JAVA PATH + - empty - + + Octave > javaaddpath('z:/dynamic'); + Octave > ps = javaclasspath('-all') + ps = + { + [1,1] = z:/someclasses.jar + [1,2] = z:/classdir/classfiles + [1,3] = z:/dynamic + } + + *See also:* *note javaaddpath: doc-javaaddpath, *note + javarmpath: doc-javarmpath, *note How to make Java + classes available to Octave?: doc-FAQ. + File: octave-java.info, Node: javaaddpath, Next: javarmpath, Prev: javaclasspath, Up: Top 3.2 javaaddpath =============== - - -- Function File: javaaddpath (PATH) - - Add PATH to the dynamic class path of the Java virtual machine. + Add PATH to the dynamic class path of the Java virtual machine. PATH can be either a directory where .class files can be found, or a .jar file containing Java classes. In both cases the directory - or file must exist. - - Example: - - This example adds a Java - archive and a directory containing .CLASS files to the CLASSPATH - and displays the current CLASSPATH list. - - Octave > javaaddpath('C:/java/myclasses.jar'); - Octave > javaaddpath('C:/java/classes'); - Octave > javaclasspath; - ans = - { - [1,1] = C:\java\myclasses.jar - [1,2] = C:\java\classes - } + or file must exist. + Example: + + This example adds a Java archive and a directory containing .CLASS + files to the CLASSPATH and displays the current CLASSPATH list. + + Octave > javaaddpath('C:/java/myclasses.jar'); + Octave > javaaddpath('C:/java/classes'); + Octave > javaclasspath; + ans = + { + [1,1] = C:\java\myclasses.jar + [1,2] = C:\java\classes + } + *See also:* *note javaclasspath: doc-javaclasspath, *note - javarmpath: doc-javarmpath, - *note How to make Java - classes available to Octave?: doc-FAQ. - + javarmpath: doc-javarmpath, *note How to make Java + classes available to Octave?: doc-FAQ. File: octave-java.info, Node: javarmpath, Next: javamem, Prev: javaaddpath, Up: Top @@ -204,29 +169,23 @@ 3.3 javarmpath ============== - - -- Function File: javarmpath (PATH) Remove PATH from the dynamic class path of the Java virtual machine. PATH can be either a directory where .class files can be - found, or a .jar file containing Java classes. - - Example: This - example removes one of the directories added in the example for - the `javaaddpath' function. - - Octave > javarmpath('C:/java/classes'); - Octave > javaclasspath - { - [1,1] = C:\java\myclasses.jar - } - + found, or a .jar file containing Java classes. + Example: This example removes one of the directories added in the + example for the `javaaddpath' function. + + Octave > javarmpath('C:/java/classes'); + Octave > javaclasspath + { + [1,1] = C:\java\myclasses.jar + } + *See also:* *note javaaddpath: doc-javaaddpath, *note - javaclasspath: doc-javaclasspath, - *note How to make - Java classes available to Octave?: doc-FAQ. - + javaclasspath: doc-javaclasspath, *note How to make Java + classes available to Octave?: doc-FAQ. File: octave-java.info, Node: javamem, Next: javaArray, Prev: javarmpath, Up: Top @@ -234,524 +193,404 @@ 3.4 javamem =========== - - -- Function File: javamem -- Function File: [JMEM] = javamem - - Show current memory status of the java virtual machine (JVM) - & run garbage collector. - - When no return argument is given the - info is echoed to the screen. - Otherwise, cell array JMEM - contains MAXIMUM, TOTAL, and - FREE memory (in bytes). - - All - java-based routines are run in the JVM's shared memory pool, - a - dedicated and separate part of memory claimed by the JVM from - your computer's total memory (which comprises physical RAM and - virtual memory / swap space on hard disk). - - The maximum - available memory can be set using the file `java.opts' - (in the - same subdirectory where `javaaddpath.m' lives, see - `which + Show current memory status of the java virtual machine (JVM) & run + garbage collector. + + When no return argument is given the info is echoed to the screen. + Otherwise, cell array JMEM contains MAXIMUM, TOTAL, and FREE + memory (in bytes). + + All java-based routines are run in the JVM's shared memory pool, a + dedicated and separate part of memory claimed by the JVM from your + computer's total memory (which comprises physical RAM and virtual + memory / swap space on hard disk). + + The maximum available memory can be set using the file `java.opts' + (in the same subdirectory where `javaaddpath.m' lives, see `which javaaddpath'. Usually that is: - - [/usr]/share/Octave/packages/java-1.2.8. - - `java.opts' is a - plain text file. It can contain memory related - options, - starting with `-X'. - In the following exmaple, the first line - specifies the initial - memory size in megabytes, the second line - specifies the requested - maximum size: - -Xms64m - -Xmx512m - You can adapt these values if your system has limited available - physical memory. When no `java.opts' file is present, the default - assignments are depending on system hardware and Java version. - Typically these are an initial memory size of RAM/64 and - a - maximum memory size of MIN(RAM/4, 1GB), where RAM - is the amount - of installed memory. - - In the output of javamem TOTAL MEMORY is - what the operating - system has currently assigned to the JVM and - depends on actual - and active memory usage. - FREE MEMORY is - self-explanatory. During operation of java-based - Octave - functions the amounts of Total and Free memory will vary, - due to - java's own cleaning up and your operating system's memory - management. - - Example: - Octave > javamem - Java virtual machine (JVM) memory info: - Maximum available memory: 247 MB; - (...running garbage collector...) - OK, current status: - Total memory in virtual machine: 15 MB; - Free memory in virtual machine: 15 MB; - 2 CPUs available. - - Octave > [MEM] = javamem() - MEM = - { - [1,1] = 259522560 - [2,1] = 16318464 - [3,1] = 16085576 - } - + [/usr]/share/Octave/packages/java-1.2.8. - *See also:* *note How can I handle memory limitations?: doc-FAQ. - + `java.opts' is a plain text file. It can contain memory related + options, starting with `-X'. In the following exmaple, the first + line specifies the initial memory size in megabytes, the second + line specifies the requested maximum size: + -Xms64m + -Xmx512m + You can adapt these values if your system has limited available + physical memory. When no `java.opts' file is present, the default + assignments are depending on system hardware and Java version. + Typically these are an initial memory size of RAM/64 and a maximum + memory size of MIN(RAM/4, 1GB), where RAM is the amount of + installed memory. + In the output of javamem TOTAL MEMORY is what the operating system + has currently assigned to the JVM and depends on actual and active + memory usage. FREE MEMORY is self-explanatory. During operation + of java-based Octave functions the amounts of Total and Free + memory will vary, due to java's own cleaning up and your operating + system's memory management. + + Example: + Octave > javamem + Java virtual machine (JVM) memory info: + Maximum available memory: 247 MB; + (...running garbage collector...) + OK, current status: + Total memory in virtual machine: 15 MB; + Free memory in virtual machine: 15 MB; + 2 CPUs available. + + Octave > [MEM] = javamem() + MEM = + { + [1,1] = 259522560 + [2,1] = 16318464 + [3,1] = 16085576 + } + + *See also:* *note How can I handle memory limitations?: doc-FAQ. + File: octave-java.info, Node: javaArray, Next: javaObject, Prev: javamem, Up: Top 3.5 javaArray ============= - - -- Function File: ARRAY = javaArray (CLASS, [M, N, ...]) -- Function File: ARRAY = javaArray (CLASS, M, N, ...) - - Create a Java array of size `[M, N, ...]' with elements of - class CLASS. CLASS can be a Java object representing a class or a - string containing the fully qualified class name. - The generated - array is uninitialized, all elements are set to null if CLASS is a + Create a Java array of size `[M, N, ...]' with elements of class + CLASS. CLASS can be a Java object representing a class or a string + containing the fully qualified class name. The generated array is + uninitialized, all elements are set to null if CLASS is a reference type, or to a default value (usually 0) if CLASS is a - primitive type. - - Example: This example creates a (2 x 2) - array of Java STRING objects and assigns a value to one of the - elements. Finally it displays the type of A. - Octave > a = javaArray('java.lang.String', 2, 2); - Octave > a(1,1) = 'Hello'; - Octave > a - a = - <Java object: java.lang.String[][]> - + primitive type. + Example: This example creates a (2 x 2) array of Java STRING + objects and assigns a value to one of the elements. Finally it + displays the type of A. + Octave > a = javaArray('java.lang.String', 2, 2); + Octave > a(1,1) = 'Hello'; + Octave > a + a = + <Java object: java.lang.String[][]> + File: octave-java.info, Node: javaObject, Next: java_new, Prev: javaArray, Up: Top 3.6 javaObject ============== - - -- Function File: OBJECT = javaObject (CLASS, [ARG1, ..., ARGN]) - - Create a Java object of class CLASS, by calling the class + Create a Java object of class CLASS, by calling the class constructor with the given arguments ARG1, ..., ARGN. The CLASS name should be given in fully qualified string form (including any package prefix). In Matlab you should avoid to use the import - statement and the short form of object creation. - - Example: - This example demonstrates two ways to create a Java `StringBuffer' - object. The first variant creates an uninitialized STRINGBUFFER - object, while the second variant calls a constructor with the - given initial `String'. Then it displays the type of `o', and - finally the content of the `StringBuffer' object is displayed by - using its `toString' method. - - Octave > o = javaObject('java.lang.StringBuffer'); - Octave > o = javaObject('java.lang.StringBuffer', 'Initial'); - Octave > o - o = - <Java object: java.lang.StringBuffer> - Octave > o.toString - ans = Initial - - Equivalent to the `java_new' function. - For compatibility with - Matlab it is recommended to use the `javaObject' function. - + statement and the short form of object creation. - *See also:* *note java_new: doc-java_new. - + Example: This example demonstrates two ways to create a Java + `StringBuffer' object. The first variant creates an uninitialized + STRINGBUFFER object, while the second variant calls a constructor + with the given initial `String'. Then it displays the type of `o', + and finally the content of the `StringBuffer' object is displayed + by using its `toString' method. + Octave > o = javaObject('java.lang.StringBuffer'); + Octave > o = javaObject('java.lang.StringBuffer', 'Initial'); + Octave > o + o = + <Java object: java.lang.StringBuffer> + Octave > o.toString + ans = Initial + + Equivalent to the `java_new' function. For compatibility with + Matlab it is recommended to use the `javaObject' function. + + *See also:* *note java_new: doc-java_new. + File: octave-java.info, Node: java_new, Next: javaMethod, Prev: javaObject, Up: Top 3.7 java_new ============ - - -- Function File: OBJECT = java_new (CLASS, [ARG1, ..., ARGN]) - - Create a Java object of class CLASS, by calling the class - constructor with the given arguments ARG1, ..., ARGN. - Equivalent to the `javaObject' function. - For compatibility with - Matlab it is recommended to use the `javaObject' function. - - Example: - Octave > o = java_new('java.lang.StringBuffer', 'Initial'); - Octave > o - o = - <Java object: java.lang.StringBuffer> - Octave > o.toString - ans = Initial - + Create a Java object of class CLASS, by calling the class + constructor with the given arguments ARG1, ..., ARGN. Equivalent + to the `javaObject' function. For compatibility with Matlab it is + recommended to use the `javaObject' function. - *See also:* *note javaObject: doc-javaObject. - + Example: + Octave > o = java_new('java.lang.StringBuffer', 'Initial'); + Octave > o + o = + <Java object: java.lang.StringBuffer> + Octave > o.toString + ans = Initial + *See also:* *note javaObject: doc-javaObject. + File: octave-java.info, Node: javaMethod, Next: java_invoke, Prev: java_new, Up: Top 3.8 javaMethod ============== - - -- Function File: RET = javaMethod (NAME, OBJECT[, ARG1, ..., ARGN]) - - Invoke the method NAME on the Java object OBJECT with the + Invoke the method NAME on the Java object OBJECT with the arguments ARG1, ... For static methods, OBJECT can be a string representing the fully qualified name of the corresponding class. - The function returns the result of the method invocation. - When + The function returns the result of the method invocation. When OBJECT is a regular Java object, the structure-like indexing can be used as a shortcut syntax. For instance, the two statements in - the example are equivalent. - - Example: - Octave > ret = javaMethod("method1", x, 1.0, "a string") - Octave > ret = x.method1(1.0, "a string") - + the example are equivalent. - *See also:* *note javamethods: doc-javamethods. - + Example: + Octave > ret = javaMethod("method1", x, 1.0, "a string") + Octave > ret = x.method1(1.0, "a string") + *See also:* *note javamethods: doc-javamethods. + File: octave-java.info, Node: java_invoke, Next: java_get, Prev: javaMethod, Up: Top 3.9 java_invoke =============== - - -- Function File: RET = java_invoke (OBJECT, NAME[, ARG1, ..., ARGN]) - - Invoke the method NAME on the Java object OBJECT with the + Invoke the method NAME on the Java object OBJECT with the arguments ARG1, ... For static methods, OBJECT can be a string representing the fully qualified name of the corresponding class. The function returns the result of the method invocation. Equivalent to the `javaMethod' function. When OBJECT is a regular Java object, the structure-like indexing can be used as a shortcut syntax. For instance, the two statements in the example are - equivalent. - - Example: - Octave > ret = java_invoke(x, "method1", 1.0, "a string") - Octave > ret = x.method1(1.0, "a string") - + equivalent. - *See also:* *note javamethods: doc-javamethods. - + Example: + Octave > ret = java_invoke(x, "method1", 1.0, "a string") + Octave > ret = x.method1(1.0, "a string") + *See also:* *note javamethods: doc-javamethods. + File: octave-java.info, Node: java_get, Next: java_set, Prev: java_invoke, Up: Top 3.10 java_get ============= - - -- Function File: VAL = java_get (OBJECT, NAME) - - Get the value of the field NAME of the Java object OBJECT. For + Get the value of the field NAME of the Java object OBJECT. For static fields, OBJECT can be a string representing the fully - qualified name of the corresponding class. - - When OBJECT is a - regular Java object, the structure-like indexing can be used as a - shortcut syntax. For instance, the two statements in the example - are equivalent - - Example: - Octave > java_get(x, "field1") - Octave > x.field1 - + qualified name of the corresponding class. - *See also:* *note javafields: doc-javafields, - *note - java_set: doc-java_set. - + When OBJECT is a regular Java object, the structure-like indexing + can be used as a shortcut syntax. For instance, the two statements + in the example are equivalent + Example: + Octave > java_get(x, "field1") + Octave > x.field1 + + *See also:* *note javafields: doc-javafields, *note + java_set: doc-java_set. + File: octave-java.info, Node: java_set, Next: javamethods, Prev: java_get, Up: Top 3.11 java_set ============= - - -- Function File: OBJECT = java_set (OBJECT, NAME, VALUE) - - Set the value of the field NAME of the Java object OBJECT to + Set the value of the field NAME of the Java object OBJECT to VALUE. For static fields, OBJECT can be a string representing the - fully qualified named of the corresponding Java class. - When + fully qualified named of the corresponding Java class. When OBJECT is a regular Java object, the structure-like indexing can be used as a shortcut syntax. For instance, the two statements in - the example are equivalent - - Example: - Octave > java_set(x, "field1", val) - Octave > x.field1 = val - + the example are equivalent - *See also:* *note javafields: doc-javafields, - *note - java_get: doc-java_get. - + Example: + Octave > java_set(x, "field1", val) + Octave > x.field1 = val + *See also:* *note javafields: doc-javafields, *note + java_get: doc-java_get. + File: octave-java.info, Node: javamethods, Next: javafields, Prev: java_set, Up: Top 3.12 javamethods ================ - - -- Function File: M = javamethods (CLASSNAME) -- Function File: M = javamethods (OBJECT) - - Given a string with a Java class name CLASSNAME or a regular - Java object OBJECT, this function returns a cell array containing + Given a string with a Java class name CLASSNAME or a regular Java + object OBJECT, this function returns a cell array containing descriptions of all methods of the Java class CLASSNAME - respectively the class of OBJECT. - - Examples: The first - example shows how the methods of a class can be queried, while the - second example works with the methods of a concrete instance of a - class. Note that creation of a `java.lang.Double' object requires - an initializer (in the example the value 1.2). - Octave > m = javamethods('java.lang.Double'); - Octave > size(m) - ans = - 1 30 - - Octave > m{7} - ans = double longBitsToDouble(long) - - Octave > o = javaObject('java.lang.Double', 1.2); - Octave > m = javamethods(o); - Octave > size(m) - ans = - 1 30 - - Octave > m{7} - ans = double longBitsToDouble(long) - + respectively the class of OBJECT. - *See also:* *note javafields: doc-javafields, - *note - java_invoke: doc-java_invoke. - + Examples: The first example shows how the methods of a class can + be queried, while the second example works with the methods of a + concrete instance of a class. Note that creation of a + `java.lang.Double' object requires an initializer (in the example + the value 1.2). + Octave > m = javamethods('java.lang.Double'); + Octave > size(m) + ans = + 1 30 + Octave > m{7} + ans = double longBitsToDouble(long) + + Octave > o = javaObject('java.lang.Double', 1.2); + Octave > m = javamethods(o); + Octave > size(m) + ans = + 1 30 + + Octave > m{7} + ans = double longBitsToDouble(long) + + *See also:* *note javafields: doc-javafields, *note + java_invoke: doc-java_invoke. + File: octave-java.info, Node: javafields, Next: msgbox, Prev: javamethods, Up: Top 3.13 javafields =============== - - -- Function File: F = javafields (CLASSNAME) -- Function File: F = javafields (OBJECT) - - Given a string with a Java class name CLASSNAME or a regular - Java object OBJECT, this function returns a cell array containing - the descriptions for all fields of the Java class CLASSNAME - respectively the class of OBJECT. - - Examples: - - The first - example shows how the fields of a class can be queried without - creating an instance of the class. - Octave > f = javafields('java.lang.Double'); - Octave > size(f) - ans = - 1 10 - - Octave > f{7} - ans = public static final int java.lang.Double.MAX_EXPONENT - - The second example works with the fields of an instance of a + Given a string with a Java class name CLASSNAME or a regular Java + object OBJECT, this function returns a cell array containing the + descriptions for all fields of the Java class CLASSNAME + respectively the class of OBJECT. + + Examples: + + The first example shows how the fields of a class can be queried + without creating an instance of the class. + Octave > f = javafields('java.lang.Double'); + Octave > size(f) + ans = + 1 10 + + Octave > f{7} + ans = public static final int java.lang.Double.MAX_EXPONENT + + The second example works with the fields of an instance of a class. Note that creation of a `java.lang.Double' object requires - an initializer (in the example a value of 1.2 is specified). - Octave > o = javaObject('java.lang.Double', 1.2); - Octave > f = javafields(o); - Octave > size(f) - ans = - 1 10 - - Octave > f{7} - ans = public static final int java.lang.Double.MAX_EXPONENT - + an initializer (in the example a value of 1.2 is specified). + Octave > o = javaObject('java.lang.Double', 1.2); + Octave > f = javafields(o); + Octave > size(f) + ans = + 1 10 - *See also:* *note java_set: doc-java_set, - *note - java_get: doc-java_get. - + Octave > f{7} + ans = public static final int java.lang.Double.MAX_EXPONENT + *See also:* *note java_set: doc-java_set, *note java_get: + doc-java_get. + File: octave-java.info, Node: msgbox, Next: errordlg, Prev: javafields, Up: Top 3.14 msgbox =========== - - -- Function File: F = msgbox (MESSAGE) -- Function File: F = msgbox (MESSAGE, TITLE) -- Function File: F = msgbox (MESSAGE, TITLE, ICON) - - Displays a MESSAGE using a dialog box. The parameter TITLE can - be used to optionally decorate the dialog caption. - The third + Displays a MESSAGE using a dialog box. The parameter TITLE can be + used to optionally decorate the dialog caption. The third optional parameter ICON can be either `'error'', `'help'' or - `'warn'' - and selectes the corresponding icon. - If it is - omitted, no icon is shown. - - Examples: The first example shows - a dialog box without a caption text, whereas the second example - specifies a caption text of its own. - The third example also - demonstrates how a character - according to the TeX symbol set - can be specified. It is important to include a space character - after the symbol code and how to embed a newline character (ASCII - code 10) into the string. - - Octave > msgbox('This is an important message'); - Octave > msgbox('Do not forget to feed the cat.', 'Remember'); - Octave > msgbox(['I \heartsuit Octave!',10, ... - ' Even if I hate it sometimes.'], ... - 'I Confess','warn'); - - |