两个 类 的正确 javadoc 注释
proper javadoc comments for two classes
现在我必须为我的代码写一些注释。
代码如下:
/**
* 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) {
.....
}
}
我知道如何为 public class 编写 javadoc 注释,但是如果 "class" 在 public class 之后编写,如何写它的 javadoc 注释?这个 class 不能是 public class。例如,在这里,我为这两个 classes,BlockGrid 和 MyWindow 写了两个 javadoc 注释,不知何故,我的 javadoc 注释只能将 public class BlockGrid 部分显示为 *.[=当我在我的终端上执行命令 javadoc BlockGrid.java 时,我会生成 18=] 文件以供检查,但是跟随它的其他 classes 无法显示。
谢谢
默认情况下,javadoc 仅包括 public 和受保护的 classes。将 -package
或 -private
添加到 javadoc 命令行以包含第二个 class 的文档。 javadoc 注释本身不需要更改。
现在我必须为我的代码写一些注释。 代码如下:
/**
* 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) {
.....
}
}
我知道如何为 public class 编写 javadoc 注释,但是如果 "class" 在 public class 之后编写,如何写它的 javadoc 注释?这个 class 不能是 public class。例如,在这里,我为这两个 classes,BlockGrid 和 MyWindow 写了两个 javadoc 注释,不知何故,我的 javadoc 注释只能将 public class BlockGrid 部分显示为 *.[=当我在我的终端上执行命令 javadoc BlockGrid.java 时,我会生成 18=] 文件以供检查,但是跟随它的其他 classes 无法显示。 谢谢
默认情况下,javadoc 仅包括 public 和受保护的 classes。将 -package
或 -private
添加到 javadoc 命令行以包含第二个 class 的文档。 javadoc 注释本身不需要更改。