【问题标题】:proper javadoc comments for two classes两个类的正确 javadoc 注释
【发布时间】:2015-08-05 18:48:32
【问题描述】:

现在我必须为我的代码编写一些 cmets。 代码如下:

/**
 * Provide a block grid of customized size and 
 * a block moving back and forth at the center
 * of the block grid.
 * @author ..
 * @version ..
 */
public class BlockGrid {
    .....
}
/**
 * This is to use the input width, height, and pixel to
 * get the actual pixel and place it.
 */
class MyWindow extends JFrame implements Runnable {
    .....(some ints here)
   /** Constructor
     * use to show the graph of the grid with new height,
     * and width depending on new pixel.
     * @param w This is the logical number of blocks in the 
                width direction.
     * @param h This is the logical number of blocks in the 
                height direction.
     * @param p This is the size of each grid square.
     */
    public MyWindow(int w, int h, int p) {
        .....

    }
}

我知道如何为公共类编写 javadoc cmets,但是如果“类”在公共类之后写,如何编写它的 javadoc cmets?这个类不能是公共类。例如,在这里,我为 BlockGrid 和 MyWindow 这两个类编写了两个 javadoc cmets,不知何故,我的 javadoc cmets 只能将公共类 BlockGrid 部分显示为 *.html 文件形式,以便我在执行命令 javadoc BlockGrid 时检查。 java 在我的终端上,但我跟随它的其他类无法显示。 谢谢

【问题讨论】:

    标签: javadoc


    【解决方案1】:

    默认情况下,javadoc 只包含公共类和受保护类。将-package-private 添加到javadoc 命令行以包含第二类的文档。 javadoc cmets 本身不需要更改。

    【讨论】:

    • 谢谢,终于见到他们了
    猜你喜欢
    • 2014-08-25
    • 2015-11-02
    • 1970-01-01
    • 2016-07-19
    • 2013-12-15
    • 1970-01-01
    • 2012-05-08
    • 2012-03-17
    • 2021-10-16
    相关资源
    最近更新 更多