我在使用 Javadoc 时遇到了一些问题。我已经为类的变量编写了文档。然后我想在构造函数中使用相同的 javaDoc。我似乎无法使用@link
或@see
用于此目的(嗯,Netbeans 没有显示我喜欢的结果)。
复制粘贴所有内容似乎很麻烦,那么是否有标签/参数可以复制 javaDoc?
这是示例:
/**
* The id for identifying this specific detectionloop. It is assumed the
* Detectionloops are numbered in order, so Detectionloop '2' is always next to
* Detectionloop '1'.
*/
private int id;
/**
* Constructor for a detectionloop. Detectionloops are real-world sensors
* that register and identify a kart when it passes by. Please note that
* this class is still under heavy development and the parameters of the
* constructor may change along the way!
*
* @param id The id for identifying this specific detectionloop. It is assumed
* the Detectionloops are numbered in order, so Detectionloop '2' is always
* next to Detectionloop '1'.
* @param nextID The id of the next detectionloop is sequense.
* @param distanceToNext The distance in meters to the next detectionloop.
*/
DetectionLoop(int id, int nextID, int distanceToNext) {
this.distanceToNext = distanceToNext;
this.id = id;
if (Detectionloops.containsKey(id)) {
throw new IllegalArgumentException("Detectionloop " + this.id
+ " already exist, please use a unused identification!");
} else {
Detectionloops.put(this.id, this);
}
}