ã³ã¡ã³ãã¯æ¸ããªãã¦ãããJavadocãæ¸ãã¦ãã
ä¼ç¤¾ã®ã¨ããããã¸ã§ã¯ãã§ã³ã¼ãã£ã³ã°ã®å¯èªæ§ã«é¢ããåå¼·ä¼ãå®æ½ãã¦ããããã
ãã®ããã¸ã§ã¯ãã¯ãªãªã¼ã¹ã¯çµãã£ã¦ä¿å®ã«ç§»è¡ãã¦ãã ãã©ä»æ´ããåå¼·ãã¦ãã®ã£ã¦æããå端ãªããæ°äººåããï¼
ãã®ããã¸ã§ã¯ãã¯ãã¡ããçä¸ãã¾ãã£ã¦ããä»ãçä¸ãã¦ãã¨æãã
ãã¦ããã®åå¼·ä¼ã®è³æãè¦ãæ©ä¼ããã£ã¦ã ãããã¯ããããå½ããåã®ãã¨ãæ¸ãã¦ããã¡ã½ããã®è¡æ°ã¨ãããããã®ã
ã§ãè³æã®ä¸ã«ã³ã¡ã³ããæ¸ãã£ã¦ããé
ç®ããã£ã¦Javadocãæ¸ãã£ã¦è¨ãé
ç®ããªãã£ãã®ã«é©ããé ããªãã£ãã
ã³ã¡ã³ããªããããJavadocã®æ¹ã大äºãªãã ã£ã¦ãã¨ãããã£ã¦ãªãã¿ããã
ã¨ãããããã®ããã¸ã§ã¯ãã§ã¯Javadocãæ¸ããªã主義ã ã£ãããããå
¨ãæå³ãããããªããæãããããã
ã¨ãåç½®ããé·ããªã£ã¦ãã¾ã£ããã ã³ã¡ã³ããæ¸ãããJavadocï¼privateã¡ã½ãããå«ãï¼ãæ¸ãæ¹ããããã ã£ã¦ãã¨ããã£ã¨ã¾ã¨ãã¦ã¿ããã¨æãã
Javadocã®æ¹ãã³ã¡ã³ããããä½ãæ¸ãã¹ãããã¯ã£ãããã¦ãã
Javadocã®æ¹ããã©ã¼ãããã決ã¾ã£ã¦ããããã¡ã½ããå ¨ä½ã«ã¤ãã¦ã®ã³ã¡ã³ããæ¸ããããªãã®ãªã®ã§ã æå³ã®ãªãæ å ±ãæ¸ããã¨ãå°ãªãã
æå³ã®ãªãæ å ±ã£ã¦ä½ãï¼ä¾ãã°ããããã®ã
i++; // å¤ãï¼ã ãå¢å ããã
ããããã®ãæ¸ãã¦ãã¾ãã®ã¯ã³ã¼ãä¸ã¤ä¸ã¤ã«å¯¾ãã¦ã³ã¡ã³ããå¿ è¦ã ã¨æã£ã¦ããããã ãã¨ãã³ã¡ã³ãã¯éè¦ãªãã¨ã ãæ¸ãã£ã¦è¨ãããã£ã¦ãä½ãéè¦ãªã®ãã¯çµé¨ç©ã¾ãªãã¨ããããªãã¨æãã
Javadocã®æ¹ãã³ã¡ã³ããã¾ã¨ã¾ã£ã¦ããã®ã§ã³ã¼ããèªã¿ããã
ã³ã¼ãã®éä¸ã«ã³ã¡ã³ããæ£å¨ãã¦ããã®ãããè¦ãããã
ãããããèªã¿ã¥ãããç¹ã«ã³ã¡ã³ããã³ã¼ãã®æ¨ªã«æ¸ãã¦ããªããã®ã¯ã
ä¾ãã°ããããã®ã
// ãªãã¸ã§ã¯ãã®æ°ã ãã«ã¼ããã for (int i = 0; i < objs.length; i++) { // ãªãã¸ã§ã¯ããæå¹ã§ããå ´å if (objs[i].isValid()) { // å®è¡ç¨ã®ã¡ã½ãããå¼ã¶ objs[i].exec(); } }
Javadocã ã¨å¥éããã¥ã¡ã³ããçæã§ãã
ã½ã¼ã¹ã³ã¼ãããä»æ§æ¸ãä½æã§ããã£ã¦è¨ãã®ãJavadocã®é
åã ããã
privateã¡ã½ããã§ãã£ã¦ãå¥éããã¥ã¡ã³ãã§ããã®ã¯ãããã¨ã ã
ä»æ§æ¸ã¨ã½ã¼ã¹ã³ã¼ããå¥ã
ã«ç®¡çãããã人ã£ã¦ãããã ãããï¼
管çã大å¤ã ããã§ããã ãã½ã¼ã¹ã³ã¼ãä¸ã«ä»æ§æ¸ãæ¸ãããã«ãã¹ãã ã¨æãã
ãã¡ããåºæ¬è¨è¨ä»æ§ã¨ãä¸æµã®ãã®ãªãå¥ææ¸ã§ç®¡çãã¦ããããã©ã
æè¿èªã¿è¿ãã¦ãã人æã®ç¥è©±ã«ãä»æ§æ¸ã¯å¥ç®¡çããã¨å¤§å¤ã ããã½ã¼ã¹ã³ã¼ãã«æ¸ãã¿ãããªãã¨ãæ¸ãã¦ãã£ãã
Javadocãæ¸ããã¨ãæèããæ¹ãè¯ãã³ã¼ããæ¸ãã
ã³ã¡ã³ãã¯å¤ããã¦ãå°ãªããã¦ããããªãã ã³ã¡ã³ããå¤ã人ã®ç¹å¾´ã¯ã³ã¼ããã¾ã¨ã¾ã£ã¦ãªãã¦ã³ã¼ãããããã«ãããããããã³ã¡ã³ãã§è£ãã¨ãããã¨ããã¦ãã ã¾ããã³ã¡ã³ãã大éã«æ¸ã人ã¯ã¡ã½ãããé·ãæ¸ãå¾åã«ããã¨æãã
ä¾ãã°ããããã®ã
public void doSomething() { // xxxãªãã¸ã§ã¯ãããç¹°ãè¿ããã¼ã¿ãåå¾ãã // åå¾ããã®ã¯ããããã®çç±ããããã ... ... ... // oooãªãã¸ã§ã¯ãã«ãã¼ã¿ãè¨å®ãã // è¨å®ããã®ã¯ããããã®çç±ããããã ... ... ... // fooã¨barãå®è¡ãã ... ... ... }
æ®éã¯åã³ã¡ã³ãã«æ¸ãã¦ããå¦çãprivateã¡ã½ããã«åãåããã¹ããªãã ãã ã³ã¡ã³ããæ¸ãã¦ããããã¨ãããã¨ã§privateã¡ã½ããã«åãåãããã¨ã横çãã¦ãã ããããå ´åã¯privateã¡ã½ããã«åãåãã¦ãã¡ãã¨Javadocãæ¸ããªãã¨ãããªãã
ã¾ã¨ã
publicã¡ã½ããã¯åºæ¬çã«ã¯Javadocãå¿ é ï¼ãã¡ããä¾å¤ããããä¾ãã°getter/setterã¨ãï¼ã§privateã¡ã½ããã¯ä»»æã ã§ããã³ã¡ã³ããæ¸ãããããªãprivateã¡ã½ããã§ãJavadocãæ¸ããæ¹ãã¡ãªããã¯å¤§ããã ã ããããªãã ãJavadocãæ¸ããã¨ãããã¨ãæèããæ¹ãããã ãã¡ããã³ã¡ã³ããæ¸ããã»ããããå ´åããããã ããåªå 度çã«ã¯ä¸ã®ãããªé ããªã