2016-09-01 13 views
0

성능 고려 사항을위한 javadoc 태그가 있습니까?성능 고려 사항을위한 Javadoc 태그

하나를 상상할 수 :

/** 
* ...other javadoc tags... 
* @perform Expected to run in O(n) time if image exists with O(k) memory usage 
*/ 
public Image getImage(URL url, String name) { 
    //code goes here 

가 내장되어 있지 않은 경우가 일부 사실상의 사람들이 사용하는 사용자 정의 태그?

답변

1

정말 표준이 없습니다. 이 작업을 수행하려는 경우 귀하 (또는 귀하의 조직)가 선호하는 형식을 유지하고 일관성을 유지하십시오.

0

Java 8부터는 @implNote이라고하는 이런 종류의 고려 사항을 위해 새 태그가 추가되었습니다.

도있다
/** 
* Picks the winners from the specified set of players. 
* <p> 
* The returned list defines the order of the winners, where the first 
* prize goes to the player at position 0. The list will not be null but 
* can be empty. 
* @implNote This implementation has linear runtime and does not filter out 
*   null players. 
* @param players 
*   the players from which the winners will be selected 
* @return the (ordered) list of the players who won; the list will not 
*   contain duplicates 
* @since 1.1 
*/ 
default List<String> pickWinners(Set<String> players) { 
    return new ArrayList<>(players); 
} 

다른 두 태그 this 질문에 설명되어있는 추가 :

으로는이처럼 사용할 수 있습니다 here을 설명했다.

이들이 javadoc 스펙의 일부가 아니며 JDK에서 오라클이 광범위하게 사용하는 것에 대한 세부 사항이 있습니다. 이 때문에, 다음과 같은 명령 줄 옵션을 사용할 필요 사항 상기와 같은 소스를 사용하려면 :

-tag "apiNote:a:API Note:" 
-tag "implSpec:a:Implementation Requirements:" 
-tag "implNote:a:Implementation Note:" 

을 그들은 (IDE를 통해 지원의 양을 다른 한 예를 들어 위의 명령 줄 인수를 설정할 수 없습니다 이클립스에서), 이는 그들이 할 수있는 것보다 덜 유용하게 만든다.