Thread: JavaDoc

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912

    JavaDoc

    Sorry for posting 2 java questions aon a c board - but half the stuff in this forum is anti-america stuff and polls, so what the heck - I'll just do it. Where exactly do I put the /** comments **/ in relation to the code that needs documenting with javadoc. For example,

    class something
    {
    public sometype somename
    public someothertype someothername
    ...
    }

    if I wanted the ^ class documented with java doc, where would I put the comments, what would I put in them, and what about functions? An actual example would be nice if you have time. Thanks.

  2. #2
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    Code:
    /** Description of class */
    class className {
       
       /**  Description of the method
       *    @param b what b is used to determine
       *    @return description of what is returned
       */
       public int doSomething(boolean b)
    }
    There is another documentation tool for C++, called Doxygen, which is similair to Javadoc. I used it to create the documentation (somewhat sparse, but it's been a solo effort thus far) here for my game.

    http://bomberlan.sourceforge.net/html/index.html

    Doxygen can be had here

    http://www.doxygen.org
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Hey thanks! But with @param b, do I put literally, @ param and then the name? And can I do the same thing with constants, etc?

  4. #4
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    Yeah, you literally put @param [name of variable] [description of variable]

    As for constants, they are described just like pretty much everything else (with a comment starting with /** before it appears).

    Code:
    /** Class containing bit packable constants that describe game object movement */
    class MovementConstants {
    
         /** Move the object to the right */
        static final int MOVE_RIGHT = 0x1;
    
         /** Move the object to the left */
        static final int MOVE_LEFT = 0x2;
    
        // etc
    }
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. c-like javadoc?
    By smo59 in forum C Programming
    Replies: 1
    Last Post: 12-03-2003, 06:09 AM