PDA

View Full Version : JavaDoc



sean
05-29-2002, 08:55 PM
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.

SilentStrike
05-29-2002, 09:19 PM
/** 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

sean
05-31-2002, 03:26 PM
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?

SilentStrike
05-31-2002, 03:32 PM
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).



/** 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
}