Re: EnumSet and varargs
John B. Matthews wrote:
I also wish there was some place to document the implicitly declared
static methods of Enum, other than the the JLS:
public static E[] values();
public static E valueOf(String name);
I strongly agree with you here. First, there's no mention of these
methods in Sun's enum tutorial, iirc.
Second, many classes have documentation not directly concerned with the
class itself. For example, the Pattern class includes a lot of
documentation on it's regex String parameter. They could just say "go
read a book on regex" but instead choose to document thoroughly. Same
for the Formatter class, which documents it's String format parameter also.
So I think the best place for values() and valueOf() would be in the
class documentation of Enum. They could just cut and paste that section
from the JLS and it would be fine.
Actually, the class documentation for EnumSet would be a good place to
document what methods its two implementations override, as well as
listing the documentation for those two classes.
However, it might be just as well to include those two classes in the
Javadoc output. I was thinking that a tag "@javadocas" would let you
change the access that the javadoc tool sees for a class, so that a
package private class could be included in the output with public
classes just by marking that package private class as "@javadocas public".
My two nickels.