Java Reference
In-Depth Information
Figure 9.5
The view into hierarchy of a
method is more insightful,
because the Hierarchy tool
window denotes where the
method has been defined,
overridden, and inherited using
graphic icons.
class. The View | Method Hierarchy ( Ctrl+Shift+H ) command lets you view
the chain of inheritance for the selected method, with special insight into which
ancestral classes are providing implementations.
Figure 9.5 shows a view of the requestCurrentRate() method from the Fixed-
RateCurrencyExchangeService class. You can see the inheritance chain for the
selected method's class, similar to the view you saw earlier of a class hierarchy. In
this view, however, a symbol next to an ancestral class indicates whether that class
has implemented the method. There are three symbols:
A plus sign (+) indicates that the method is implemented in the class.
A minus sign (-) indicates that the method isn't implemented in the class.
An exclamation mark (!) indicates that the method isn't defined, but it
should be because it's required by the interface or an abstract method of its
superclass.
In this example, you can see that the requestCurrentRate() method is originally
defined by the CurrencyExchangeService interface and implemented in the Fixed-
RateCurrencyExchangeService class. As with other views of this type, you can use
the view as a navigation shortcut (with Autoscroll to Source enabled, click the class
to view it in the editor, or press F4 ). Other common operations are available
through the context menu.
Viewing call hierarchy
The View | Call Hierarchy ( Ctrl+Alt+H ) command is probably the most com-
plex of the structure-oriented views. It's used to trace the usage of the currently
selected method by exploring its calling hierarchy. Like the Find Usages com-
mand, the call hierarchy displays a list of all the calls being made to the method.
 
 
 
 
 
 
 
Search WWH ::




Custom Search