public abstract class

MethodImpl

extends TypeComponentImpl
implements Method
java.lang.Object
   ↳ com.sun.tools.jdi.TypeComponentImpl
     ↳ com.sun.tools.jdi.MethodImpl
Known Direct Subclasses
Known Indirect Subclasses

Summary

[Expand]
Inherited Fields
From class com.sun.tools.jdi.TypeComponentImpl
Public Methods
List<Location> allLineLocations(String stratumID, String sourceName)
Returns a list containing a Location object for each executable source line in this method.
final List<Location> allLineLocations()
Returns a list containing a Location object for each executable source line in this method.
List<String> argumentSignatures()
List<String> argumentTypeNames()
Returns a list containing a text representation of the type of each formal parameter of this method.
List<Type> argumentTypes()
Returns a list containing the type of each formal parameter of this method.
int compareTo(Method method)
boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.
Type findType(String signature)
int hashCode()
Returns a hash code value for the object.
boolean isAbstract()
Determine if this method is abstract.
boolean isBridge()
Determine if this method is a bridge method.
boolean isConstructor()
Determine if this method is a constructor.
boolean isNative()
Determine if this method is native.
boolean isObsolete()
Determine if this method is obsolete.
boolean isStaticInitializer()
Determine if this method is a static initializer.
boolean isSynchronized()
Determine if this method is synchronized.
boolean isVarArgs()
Determine if this method accepts a variable number of arguments.
List<Location> locationsOfLine(String stratumID, String sourceName, int lineNumber)
Returns a List containing all Location objects that map to the given line number and source name.
final List<Location> locationsOfLine(int lineNumber)
Returns a List containing all Location objects that map to the given line number.
Type returnType()
Returns the return type, as specified in the declaration of this method.
String returnTypeName()
Returns a text representation of the return type, as specified in the declaration of this method.
String toString()
Returns a string representation of the object.
[Expand]
Inherited Methods
From class com.sun.tools.jdi.TypeComponentImpl
From class java.lang.Object
From interface com.sun.jdi.Accessible
From interface com.sun.jdi.Locatable
From interface com.sun.jdi.Method
From interface com.sun.jdi.Mirror
From interface com.sun.jdi.TypeComponent
From interface java.lang.Comparable

Public Methods

public List<Location> allLineLocations (String stratumID, String sourceName)

Returns a list containing a Location object for each executable source line in this method.

Each location maps a source line to a range of code indices. The beginning of the range can be determined through codeIndex(). The returned list is ordered by code index (from low to high).

The returned list may contain multiple locations for a particular line number, if the compiler and/or VM has mapped that line to two or more disjoint code index ranges.

If the method is native or abstract, an empty list is returned.

Returned list is for the specified stratum (see Location for a description of strata).

Parameters
stratumID The stratum to retrieve information from or null for the defaultStratum()
sourceName Return locations only within this source file or null to return locations.
Returns
  • a List of all source line Location objects.

public final List<Location> allLineLocations ()

Returns a list containing a Location object for each executable source line in this method.

This method is equivalent to allLineLocations(vm.getDefaultStratum(),null) - see allLineLocations(String, String) for more information.

Returns
  • a List of all source line Location objects.

public List<String> argumentSignatures ()

public List<String> argumentTypeNames ()

Returns a list containing a text representation of the type of each formal parameter of this method.

This list is always available even if the types have not yet been created or loaded.

Returns
  • a List of String, one List element for each parameter of this method. Each element represents the type of a formal parameter as specified at compile-time. If the formal parameter was declared with an ellipsis, then it is represented as an array of the type before the ellipsis.

public List<Type> argumentTypes ()

Returns a list containing the type of each formal parameter of this method.

Note: if there is any parameter whose type is a reference type (class, interface, or array) and it has not been created or loaded by the declaring type's class loader - that is, declaringType() .classLoader(), then ClassNotLoadedException will be thrown. Also, a reference type may have been loaded but not yet prepared, in which case the list will be returned but attempts to perform some operations on the type (e.g. fields()) will throw a ClassNotPreparedException. Use isPrepared() to determine if a reference type is prepared.

Returns
  • return a List of Type, one List element for each parameter of this method. Each element represents the type of a formal parameter as specified at compile-time. If the formal parameter was declared with an ellipsis, then it is represented as an array of the type before the ellipsis.

public int compareTo (Method method)

public boolean equals (Object obj)

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).

Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

Parameters
obj the reference object with which to compare.
Returns
  • true if this object is the same as the obj argument; false otherwise.

public Type findType (String signature)

public int hashCode ()

Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables.

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Returns
  • a hash code value for this object.

public boolean isAbstract ()

Determine if this method is abstract.

Returns
  • true if the method is declared abstract; false otherwise.

public boolean isBridge ()

Determine if this method is a bridge method. Bridge methods are defined in the "JavaTM Language Specification, 3rd Edition.

Returns
  • true if the method is a bridge method, false otherwise.

public boolean isConstructor ()

Determine if this method is a constructor.

Returns
  • true if the method is a constructor; false otherwise.

public boolean isNative ()

Determine if this method is native.

Returns
  • true if the method is declared native; false otherwise.

public boolean isObsolete ()

Determine if this method is obsolete.

Returns

public boolean isStaticInitializer ()

Determine if this method is a static initializer.

Returns
  • true if the method is a static initializer; false otherwise.

public boolean isSynchronized ()

Determine if this method is synchronized.

Returns
  • true if the method is declared synchronized; false otherwise.

public boolean isVarArgs ()

Determine if this method accepts a variable number of arguments.

Returns
  • true if the method accepts a variable number of arguments, false otherwise.

public List<Location> locationsOfLine (String stratumID, String sourceName, int lineNumber)

Returns a List containing all Location objects that map to the given line number and source name.

Returns a list containing each Location that maps to the given line. The returned list will contain a location for each disjoint range of code indices that have been assigned to the given line by the compiler and/or VM. Each returned location corresponds to the beginning of this range. An empty list will be returned if there is no executable code at the specified line number; specifically, native and abstract methods will always return an empty list.

Returned list is for the specified stratum (see Location for a description of strata).

Parameters
stratumID the stratum to use for comparing line number and source name, or null to use the default stratum
sourceName the source name containing the line number, or null to match all source names
lineNumber the line number
Returns
  • a List of Location objects that map to the given line number.

public final List<Location> locationsOfLine (int lineNumber)

Returns a List containing all Location objects that map to the given line number.

This method is equivalent to locationsOfLine(vm.getDefaultStratum(), null, lineNumber) - see locationsOfLine(java.lang.String, java.lang.String, int) for more information.

Parameters
lineNumber the line number
Returns
  • a List of Location objects that map to the given line number.

public Type returnType ()

Returns the return type, as specified in the declaration of this method.

Note: if the return type of this method is a reference type (class, interface, or array) and it has not been created or loaded by the declaring type's class loader - that is, declaringType() .classLoader(), then ClassNotLoadedException will be thrown. Also, a reference type may have been loaded but not yet prepared, in which case the type will be returned but attempts to perform some operations on the returned type (e.g. fields()) will throw a ClassNotPreparedException. Use isPrepared() to determine if a reference type is prepared.

Returns
  • the return Type of this method.

public String returnTypeName ()

Returns a text representation of the return type, as specified in the declaration of this method.

This type name is always available even if the type has not yet been created or loaded.

Returns
  • a text representation of the declared return type of this method.

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a string representation of the object.