2007-03-01ãã1ã¶æéã®è¨äºä¸è¦§
åªç§ãªã·ã¹ãã ã¨ã³ã¸ãã¢ã¯"èªç¶ã«"è«ççãªæèãè¡ã£ã¦ãã¾ãã ããããã»ã¨ãã©ã®äººã¯ãã¸ã«ã«ã·ã³ãã³ã°ã¨å¼ã°ããã¹ãã«ãå¦ç¿ãã¦è«ççæèãåºæ¥ãããã«ãªã£ãã¨ã¯è¨ããªãã§ãããã å½¼ãã¯å¦çæ代ã®åå¼·ã趣å³ãªã©ãéãã¦è«ççãªæèãèªç¶â¦
ããã°ã©ãã³ã°ãçæ¥ã¨ãããªãã°ãè«ççæèï¼ãã¸ã«ã«ã·ã³ãã³ã°ï¼ã¯æ¬ ãããã¨ã®ã§ããªãæãéè¦ãªã¹ãã«ã§ãã è«ççã§ãªãä»æ§ã«ã¯å¿ ãä»æ§æ¼ããä¸åããããã®ã§ãã è«ççã§ãªãã½ã¼ã¹ã³ã¼ãã¯é常ã«èªã¿è¾ãã¡ã³ããã³ã¹ãé£ãããã®ã¨ãªãã¾â¦
æ£è¦è¡¨ç¾(Regular Expression)ã¨ã¯æååãç¹å®ã®ãã¿ã¼ã³ã§è¡¨ãé常ã«å¼·åãªãã©ã¼ãããã§ãã æ£è¦è¡¨ç¾ãç¨ããäºã§æååãå¼ã¨ãã¦æ±ããã¨ãã§ããçºãæååã«å¯¾ãã¦æè»ãªæ¤ç´¢ãç½®æãè¡ãäºãå¯è½ã¨ãªãã¾ãã ãã®æ£è¦è¡¨ç¾ã¯Javaç¹æã®æè¡ã¨ããâ¦
ã·ã¹ãã ã¨ã³ã¸ãã¢ã®å½¹å²ã¯è¦ä»¶å®ç¾©ã»è¨è¨ã»å®è£ ã¾ã§åã¶çºãå¤ç¨®å¤æ§ã®ã¹ãã«ãæ±ãããã¾ãã ãããã®ã¹ãã«ã¯ãæè¡åããã³ãã¥ãã±ã¼ã·ã§ã³è½åããè«ççæèè½åãã®ï¼ã¤ã«åé¡ãã¦èããäºãã§ãã¾ãã æè¡å ã½ããã¦ã§ã¢éçºã§ã¯æçµçã«ããã°â¦
é åã¯åãåã®å¤æ°ãã¾ã¨ãã¦æ±ããã¼ã¿æ§é ã§ããããªãã¸ã§ã¯ãï¼åç §ï¼åã ãã§ã¯ãªãããªããã£ãåã®é åãæ±ãäºãã§ãã¾ãã ããªããã£ãåé åãé åã§ãã以ä¸ã¯ã¯ã©ã¹ã«è¿ãåã§ãããã¤ã³ã¹ã¿ã³ã¹ãçæãã¦ä½¿ãå¿ è¦ãããã¾ãã ããã¯ããªãâ¦
é åã¨ã¯åãåã®å¤æ°ãã¾ã¨ãã¦æ ¼ç´ããäºãã§ãããã¼ã¿æ§é ã§ãCè¨èªãã¯ããã¨ããã»ã¨ãã©ã®è¨èªã§ãµãã¼ããã¦ãã¾ãã Javaã§ãCè¨èªã¨åãããã«é åãæ±ããã¨ãã§ãã¾ãããJavaã®é åã¯Cè¨èªã®é åã¨ã¯ä»çµã¿ãç°ãªãçºãå åã«æ³¨æããå¿ è¦ããâ¦
ä¾å¤å¦çã¯æå¹ãªæ©è½ã§ããã使ãæ¹ã誤ãã¨çºè¦ãã«ãããã°ãæ··å ¥ããã¦ãã¾ãã¾ãã ä»åã¯ä¾å¤å¦ç(1)(2)ã§èª¬æã§ããªãã£ãå¹¾ã¤ãã®æ©è½ã¨å®è£ ä¸ã®æ³¨æç¹ã説æãã¾ãã finallyããã㯠try/catchæ§æã«ã¯finallyãããã¯ã追å ããäºãã§ãã¾ãã trâ¦
Javaã®å é¨ã§ã¯æåï¼charï¼ã¯å ¨ã¦Unicodeã§è¡¨ããã¦ãããæ¥æ¬èªãå«ãã¦ã»ã¨ãã©ã®è¨èªã"èªç¶ã«"æ±ããã¨ãã§ãã¾ãã ããã¯å½éåï¼å¤è¨èªå¯¾å¿ï¼ãããã¢ããªã±ã¼ã·ã§ã³ãéçºããã¨ãã«ã¯å¤§ããªã¡ãªããã¨ãªãã¾ãã æååã®é·ã æ¢ã«å¦ç¿ããããã«â¦
ãã¼ã¸ã½ã¼ãã¯ããªã¹ãï¼ArrayListãªã©ï¼ãåå²ãã¦ãããåå²ãããè¦ç´ ããã¼ã¸ï¼çµåï¼ãã¦ããäºã§ã½ã¼ããè¡ãã¢ã«ã´ãªãºã ã§ãã ãªã¹ãã®è¦ç´ ã¯ãã©ãã©ã«åå²ããã¾ããããã©ãã©ã«ãªã£ãè¦ç´ ã¯é£å士ã大å°æ¯è¼ããªããçµåï¼ãã¼ã¸ï¼ãã¾ãã ãâ¦
ããã«ã½ã¼ãï¼Bubble Sortï¼ã¯é£ãåã£ã2ã¤ã®è¦ç´ ãæ¯è¼ãé åºãå ¥ãæ¿ããã¨ããå¦çãç¹°ãè¿ããã¨ã§ã½ã¼ããå®ç¾ããã¢ã«ã´ãªãºã ã§ãã ãã®åã®éãã泡ã®ããã«å¤§ããªï¼å°ããªï¼è¦ç´ ãä¸ã«æµ®ãã¦ãããããªã¤ã¡ã¼ã¸ã¨ãªãã¾ãã èããã ãã§ã¯ãã©â¦
é¸æã½ã¼ãï¼Selection Sortï¼ãåºæ¬çãªã½ã¼ãã¢ã«ã´ãªãºã ã§ãã æ¿å ¥ã½ã¼ãï¼Insertion Sortï¼ã§ã¯ãç¡ä½çºã«ï¼è¦ç´ ã¥ã¤é¸ã³åºããé©å½ãªå ´æã«æ¿å ¥ãã¦ããæé ãè¸ã¿ã¾ããã ããã«å¯¾ãã¦é¸æã½ã¼ãã§ã¯ãæãå°ããï¼å¤§ããï¼è¦ç´ ããé ã«é¸ã³åºããâ¦
æ¿å ¥ã½ã¼ãï¼Insertion Sortï¼ã¯æãåºæ¬çãªã½ã¼ãã¢ã«ã´ãªãºã ã§ããæã ã®æ®æ®µã®çæ´»ã®ä¸ã§ã馴æã¿æ·±ãã¢ã«ã´ãªãºã ã§ããã©ã³ãã®ææã®æ´åã麻éã®çãæ´åãããæã«èªç¶ã¨è¡ã£ã¦ãã¾ãã æã ã®è¡ãæ¿å ¥ã½ã¼ãã§ã¯è¦ç´ ãï¼ã¤ã¥ã¤é©åãªä½ç½®ã«æ¿å ¥ãâ¦
ç·å½¢æ¤ç´¢ï¼Linear Searchï¼ã¯æãåºæ¬çãªæ¤ç´¢ã¢ã«ã´ãªãºã ã§ãç®çã®ãã¼ã¿ãæ¢ãçºã«éåããè¦ç´ ãï¼ã¤ã¥ã¤åãåºãæ¯è¼ãã¦ããæé ãè¸ã¿ã¾ããç·å½¢æ¤ç´¢ã¯é常ã«è§£ããããåç´ã§ãã ãããããã¼ã¿ããã¾ãã¾ï¼ã¤ç®ã«ãã£ããªãã°ï¼åã§ç®çã®ãã¼ã¿â¦
ã¢ã«ã´ãªãºã (algorithm)ã¨ã¯ããç®çãå®ç¾ããçºã®ä¸é£ã®æé ã®äºã§ãã ã¢ã«ã´ãªãºã (algorithm) ã¯ããªãããã®åé¡ã解ãããã®æé ã®ãã¨ã§ãããç®æ³ï¼ããã½ãï¼ã¨è¨³ããããã¨ãããã http://ja.wikipedia.org/wiki/%E3%82%A2%E3%83%AB%E3%82%B4%â¦
ä¾å¤ã¯å¼ã³åºãå ã«æ»ãå¤ã¨ãã¦è¿ãããã®ã§ã¯ãªããthrowããä¸ä½ã¡ã½ããã«ä¼æããããã®ã§ããã ã©ããªå ´åã§ãJavaä»®æ³ãã·ã³ï¼JVMï¼ã«ä¾å¤å¦çãä»»ããäºã許ããããªãã°è¯ãã®ã§ãããã©ããªä¾å¤ã§ãçºçãããªãã°ã¢ããªã±ã¼ã·ã§ã³ãçµäºãã¦ãã¾â¦
ä¾å¤(Exception)ã¯Javaã®éè¦æ©è½ã®ï¼ã¤ã§ãããé©åãªä½¿ãæ¹ãããªããã°å¤§ããªãã°ã¨ããªãå¾ã¾ãã ç¹ã«åå¦è ã«ã¨ã£ã¦ä¾å¤ã¯è§£ãã«ããå ¥éæ¸ã§ãæ·±ã触ãã¦ããªãçºããã解ããªãã¾ã¾ã«ãããå¾åã«ããã¾ãã ããããæ¥åã§Javaãæ±ãã®ã§ããã°ä¾å¤â¦