The Javadoc Use pages
At the top of a standard Javadoc page for a Java class or interface, viewed in your favorite Web browser, you’re going to see links for “Overview,” “Package,” “Use,” “Tree,” etc.
The “Package” link is quite obvious. Like, for example, you’re looking at the Javadoc webpage for java.util.ArrayList
, the “Package” link will take you to a page listing the classes and interfaces in java.util
.
What is the “Use” link about? I din’t know, I had noticed it but had never bothered to check it out until I was trying to figure out why the Javadoc tool had generated certain files I didn’t want it to generate.
And as I looked at it, I realized that the Javadoc “Use” pages have a lot of very useful information about how a particular class or interface is used.
A “Use” page first lists the packages that use a particular class or interface. Then for each of those packages, there is a list of the fields that are of that type in the package, the functions (methods) that return objects of that type and the subclasses or implementing classes.
For example, in the Java Development Kit (JDK) 8, there are five packages that use java.util.ArrayList
, and java.util
is of course one of those five.
Categories that are not applicable are simply omitted. For example, in the java.awt.dnd
package, events
is an ArrayList<InputEvent>
field in the DragGestureRecognizer
class, but there are no functions that return ArrayList<E>
instances nor subclasses of ArrayList<E>
, so those latter two headings are left out.
Similarly, in the javax.management
package, AttributeList
is a subclass of ArrayList<E>
, and in MBeanServerFactory
, the findMBeanServer()
function returns an ArrayList<MBeanServer>
, but there are no fields declared as ArrayList<E>
.
If you ever find yourself not quite understanding what a class or interface is for, or wondering if what you’re thinking of using it for is quite right from reading the “Class” page, try looking at the “Use” page to see if it makes more sense.