Method Information
Display Method Names
The methods
function returns information on methods
of MATLAB® and Java® classes.
To return the names of all the methods (including inherited methods) of the class, use
methods
without the '-full'
qualifier. Names of
overloaded methods are listed only once.
Display Method Signatures
With the '-full'
qualifier, methods
returns a
listing of the method names (including inherited methods) along with attributes, argument
lists, and inheritance information on each. Each overloaded method is listed
separately.
For example, display a full description of all methods of the
java.awt.Dimension
object.
methods java.awt.Dimension -full
Methods for class java.awt.Dimension: Dimension() Dimension(java.awt.Dimension) Dimension(int,int) java.lang.Class getClass() % Inherited from java.lang.Object int hashCode() % Inherited from java.lang.Object boolean equals(java.lang.Object) java.lang.String toString() void notify() % Inherited from java.lang.Object void notifyAll() % Inherited from java.lang.Object void wait(long) throws java.lang.InterruptedException % Inherited from java.lang.Object void wait(long,int) throws java.lang.InterruptedException % Inherited from java.lang.Object void wait() throws java.lang.InterruptedException % Inherited from java.lang.Object java.awt.Dimension getSize() void setSize(java.awt.Dimension) void setSize(int,int)
Display Syntax in Figure Window
To see methods implemented by a particular Java (or MATLAB) class, use the methodsview
function. Specify the class name
(along with its package name, for Java classes) in the command line. If you have imported the package that defines
this class, then the class name alone suffices.
This command lists information on all methods in the
java.awt.MenuItem
class:
methodsview java.awt.MenuItem
A new window appears, listing one row of information for each method in the class. Each row in the window displays these fields of information describing the method.
Fields Displayed in methodsview
Window
Field Name | Description | Examples |
---|---|---|
Name | Method name |
|
Return Type | Type returned by the method |
|
Arguments | Types of arguments passed to method |
|
Qualifiers | Method type qualifiers | abstract, synchronized |
Other | Other relevant information | throws |
Inherited From | Parent of the specified class |
|