微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

JavaDoc 反馈

如何解决JavaDoc 反馈

这是我写的 javadoc,这是记录文档的正确方式吗?如果是,有什么方法可以改进我的文档?

/**
 * Description: with the dna sequence provided the each letter will be check if 
*  the strand is a C. If the strand is C it will keep the amount and record of how many are 
     *  in the Sequence  
     * pre: needs the dna sequence 
     * @param string 
     * post: the amount of c in the sequence 
     * @returns int 
     */

我了解文档有多种格式。

解决方法

原创

/**
 * Description: with the dna sequence provided the each letter will be check if 
*  the strand is a C. If the strand is C it will keep the amount and record of how many are 
     *  in the Sequence  
     * pre: needs the dna sequence 
     * @param string 
     * post: the amount of c in the sequence 
     * @returns int 
     */

修改

  1. 您不需要在描述前加上“描述”。预计您将要编写的内容描述了该函数的预期用途。我绝对能理解为什么你会惯性地认为包括这个。
  2. 语法可以改进; '每个字母都将被检查',不会让这感觉像一个专业的javadoc。如果英语不是您的第一语言,那么学习第二语言真是太好了!我们可以改进这一点!
  3. 我可能是错的,但由于描述/前/后,感觉你可能来自 QA/测试背景。如果是这样,很好地描述了这个,这包含了你需要的一切,但格式有点不对。我们可以解决这个问题!
  4. String 不是描述性参数,可以将其称为“序列”之类的东西。
/**
 * Calculates the occurrences of the DNA strand 'C' in the sequence provided.  
 * 
 * @param sequence the sequence of DNA which may or may not include 
 *        one or more occurrences of the expected 'C' DNA. 
 * @return the total sum of occurrences for 'C',if any. Zero may be returned. 
 */

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。