JavaDoc 覆盖
JavaDoc Override
首先要解决重复的可能性:
我不是问 Override 是什么,它是什么意思,或者 java 文档评论 之外的 @Override .那就是我不是问
/**Some JavaDoc Comment*/
@override
public void methodA(){}
这是什么意思。希望我强调得不够好。 我也不是询问何时使用@Override或javadoc是什么或怎么做 java 文档评论。 (是的,我强调了很多,但我宁愿详细说明问题,也不愿无缘无故地被标记为重复)。
现在回答问题:
在 java 文档中,比较器 class:https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#compare-T-T-
具有以下 equals 方法说明:
Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare.
Returns:
true only if the specified object is also a comparator and it imposes the same ordering as this comparator.
See Also:
Object.equals(Object), Object.hashCode()
如何获取 JavaDoc 中的 Overrides 标记。当我放置@Overrides 时,它会逐字输入描述“@Overrides”。我如何让比较器 class 中的 JavaDoc 标记显示 Overrides: equals in class Object
?
基于此tech note(部分"Automatic re-use of method comments ",大约向下三分之一),如果一个方法覆盖另一个方法,JavaDoc 工具会自动生成"Overrides" 部分.
来自前述link:
You can avoid re-typing doc comments by being aware of how the Javadoc tool duplicates (inherits) comments for methods that override or implement other methods. This occurs in three cases:
When a method in a class overrides a method in a superclass
When a method in an interface overrides a method in a superinterface
When a method in a class implements a method in an interface
In the first two cases, if a method m() overrides another method, The Javadoc tool will generate a subheading "Overrides" in the documentation for m(), with a link to the method it is overriding.
In the third case, if a method m() in a given class implements a method in an interface, the Javadoc tool will generate a subheading "Specified by" in the documentation for m(), with a link to the method it is implementing.
In all three of these cases, if the method m() contains no doc comments or tags, the Javadoc tool will also copy the text of the method it is overriding or implementing to the generated documentation for m(). So if the documentation of the overridden or implemented method is sufficient, you do not need to add documentation for m(). If you add any documentation comment or tag to m(), the "Overrides" or "Specified by" subheading and link will still appear, but no text will be copied.
首先要解决重复的可能性:
我不是问 Override 是什么,它是什么意思,或者 java 文档评论 之外的 @Override .那就是我不是问
/**Some JavaDoc Comment*/
@override
public void methodA(){}
这是什么意思。希望我强调得不够好。 我也不是询问何时使用@Override或javadoc是什么或怎么做 java 文档评论。 (是的,我强调了很多,但我宁愿详细说明问题,也不愿无缘无故地被标记为重复)。
现在回答问题:
在 java 文档中,比较器 class:https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#compare-T-T- 具有以下 equals 方法说明:
Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare.
Returns:
true only if the specified object is also a comparator and it imposes the same ordering as this comparator.
See Also:
Object.equals(Object), Object.hashCode()
如何获取 JavaDoc 中的 Overrides 标记。当我放置@Overrides 时,它会逐字输入描述“@Overrides”。我如何让比较器 class 中的 JavaDoc 标记显示 Overrides: equals in class Object
?
基于此tech note(部分"Automatic re-use of method comments ",大约向下三分之一),如果一个方法覆盖另一个方法,JavaDoc 工具会自动生成"Overrides" 部分.
来自前述link:
You can avoid re-typing doc comments by being aware of how the Javadoc tool duplicates (inherits) comments for methods that override or implement other methods. This occurs in three cases:
When a method in a class overrides a method in a superclass When a method in an interface overrides a method in a superinterface When a method in a class implements a method in an interface In the first two cases, if a method m() overrides another method, The Javadoc tool will generate a subheading "Overrides" in the documentation for m(), with a link to the method it is overriding.
In the third case, if a method m() in a given class implements a method in an interface, the Javadoc tool will generate a subheading "Specified by" in the documentation for m(), with a link to the method it is implementing.
In all three of these cases, if the method m() contains no doc comments or tags, the Javadoc tool will also copy the text of the method it is overriding or implementing to the generated documentation for m(). So if the documentation of the overridden or implemented method is sufficient, you do not need to add documentation for m(). If you add any documentation comment or tag to m(), the "Overrides" or "Specified by" subheading and link will still appear, but no text will be copied.