Method visibility
Continuing the tour, several controls affect how many methods you can see in the method pane. The radio button under the classes pane enables you to look at either public or private methods. You can filter the methods you see by controlling which categories are selected in the categories pane. You can select more than one category by either dragging the pointer across them or, while pressing the Ctrl key, clicking on them.
Another way to control the number of methods displayed is to set the inheritance. Do the following:
1. Be sure you are looking at the CLDT-API public instance methods.
2. Look for a method called printOn:. (Hint: the method is not there.)
3. From the Methods pop-up menu, select Visibility, then To Root Class.
4. Now look for the method printOn:.
There are two methods named printOn:. One is defined in Collection, the other in Object.
Tip
When you cannot find a method that you know a class understands, check the method visibility from the Methods pop-up menu. If the method is inherited, the visibility should be set to at least the superclass that actually defines the method.
5. Most of the time you will not want to look at all of the methods from a root class such as Object. (Unless, of course, you are looking at the class Object.) Try setting the method visibility at To Root Minus One. Now the method pane shows methods defined by Bag and Collection.
Last modified date: 03/26/2020