From: markspace on
Peter Duniho wrote:

> I don't think that the methods should in fact appear in the list of
> methods for the java.lang.Enum class, but yes�definitely, the
> documentation should discuss them _somewhere_.


I agree not with the list of methods; those two methods aren't members
of Enum class and it would be really confusing to add them there.

As I said, that section of the JLS should be copied into the class
documentation, which is to say the blob of text that precedes the list
of methods. They could just cut-and-paste the same section that I did
and it would be perfectly readable.
From: Marc van Dongen on
On Feb 23, 5:03 am, Peter Duniho <NpOeStPe...(a)NnOwSlPiAnMk.com> wrote:
> Marc van Dongen wrote:
> > Howsagoin,
>

[ snip ]

> You should be looking in the latest version documentation (i.e. Java 6:http://java.sun.com/javase/6/docs/api/java/lang/Enum.html).
>
> But, that particular method is, as I understand it, automatically
> generated by the compiler.  It won't show up in the API documentation,
> as it's not actually part of the java.lang.Enum type itself, but rather
> something that shows up in each actual declared enum automatically.
>
> You can probably find details in the Java specification.

Thanks. I am aware that this method is generated and I know what it
does.
Still I think it makes sense to include the method in the API docs. A
programmer of the java language should be able to find the method's
documentation without any knowledge about the java implementation.

Regards,


Marc van Dongen
From: Marc van Dongen on
On Feb 23, 5:15 am, markspace <nos...(a)nowhere.com> wrote:

> Yup, you can find it in section 8.9 of the JLS:
>
> <http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.9>

[ snip ]

>      public static E[] values();

Thanks. I've googled around a bit and this is the first time I see
an explicit type signature for the method. All other references to
the method describe the method in words.

Thanks again.

Regards,


Marc van Dongen
From: Peter Duniho on
Marc van Dongen wrote:
> [...]
> Still I think it makes sense to include the method in the API docs. A
> programmer of the java language should be able to find the method's
> documentation without any knowledge about the java implementation.

As you can see my discussion with "markspace", I agree it should be
documented in the remarks for the java.lang.Enum class. However, it's
also true that a programmer of the Java language should be familiar
with, and be comfortable reviewing, the Java Language Specification.

If you think of the JLS as "implementation" (I don't, but that's a
separate matter), then it's not true you should be able to write Java
code without any knowledge of the JLS. Whether you read the JLS itself,
or just learn about it through other documentation, you _must_ have
knowledge of the JLS. It's not possible to write Java code otherwise.

Pete
From: Lew on
markspace wrote:
>> Yup, you can find it in section 8.9 of the JLS:
>>
>> <http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.9>
>
> [ snip ]
>
>> public static E[] values();

Marc van Dongen wrote:
> Thanks. I've googled around a bit and this is the first time I see
> an explicit type signature for the method. All other references to
> the method describe the method in words.

You should get in the habit of reading the JLS.

--
Lew