{"id":5424,"date":"2019-10-19T13:16:46","date_gmt":"2019-10-19T04:16:46","guid":{"rendered":"https:\/\/pandanote.info\/?p=5424"},"modified":"2019-10-19T13:19:40","modified_gmt":"2019-10-19T04:19:40","slug":"java%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b9%e5%90%8d%e3%82%92%e8%80%83%e3%81%88%e3%81%9f%e3%82%8a%e3%80%81%e6%80%9d%e3%81%84%e5%87%ba%e3%81%97%e3%81%9f%e3%82%8a%e3%81%99%e3%82%8b%e3%81%ae%e3%81%ab","status":"publish","type":"post","link":"https:\/\/pandanote.info\/?p=5424","title":{"rendered":"Java\u306e\u30af\u30e9\u30b9\u540d\u3092\u8003\u3048\u305f\u308a\u3001\u601d\u3044\u51fa\u3057\u305f\u308a\u3059\u308b\u306e\u306b\u75b2\u308c\u305f\u982d\u306b\u306f\u3001Scala\u306e\u30bf\u30d7\u30eb\u304c\u52b9\u304f\u304b\u3082\u3057\u308c\u306a\u3044\u4ef6\u3002"},"content":{"rendered":"<h2>\u306f\u3058\u3081\u306b<\/h2>\n<p>Scala\u3067\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u3067\u305d\u308c\u306a\u308a\u306b\u307e\u3068\u307e\u3063\u305f\u6a5f\u80fd\u304c\u5b9f\u73fe\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u5b9f\u904b\u7528\u3092\u884c\u3046\u65e5\u304c\u8fd1\u3065\u3044\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>Scala\u3067\u306f\u30eb\u30fc\u30d7\u51e6\u7406\u3068\u30bf\u30d7\u30eb\u3092\u3046\u307e\u304f\u4f7f\u3046\u3068\u3001Java\u3088\u308a\u3082\u304b\u306a\u308a\u52b9\u7387\u306e\u3088\u3044\u5b9f\u88c5\u304c\u3067\u304d\u307e\u3059\u3002\u304b\u3064\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u6a2a\u9577\u306b\u306a\u308a\u307e\u3059\u2193<\/p>\n<p><a href=\"https:\/\/pandanote.info\/?attachment_id=5441\" rel=\"attachment wp-att-5441\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pandanote.info\/wordpress\/wp-content\/uploads\/2019\/10\/scala_repl_scene2-300x99.png\" alt=\"\" width=\"300\" height=\"99\" class=\"alignnone size-medium wp-image-5441\" srcset=\"https:\/\/pandanote.info\/wordpress\/wp-content\/uploads\/2019\/10\/scala_repl_scene2-300x99.png 300w, https:\/\/pandanote.info\/wordpress\/wp-content\/uploads\/2019\/10\/scala_repl_scene2.png 649w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u307e\u305f\u3001\u51e6\u7406\u306e\u7a2e\u985e\u306b\u3088\u3063\u3066\u306f\u30b3\u30fc\u30c9\u304b\u8aad\u307f\u3084\u3059\u304f\u306a\u308b\u5834\u5408\u3055\u3048\u3042\u308a\u307e\u3059(\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3053\u306e\u70b9\u306b\u3064\u3044\u3066\u306e\u8a73\u7d30\u306f\u5272\u611b\u3057\u307e\u3059)\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001\u3053\u306e\u8a18\u4e8b\u3067\u306f\u30eb\u30fc\u30d7\u51e6\u7406\u306b\u3064\u3044\u3066\u306f\u3061\u3087\u3063\u3068\u8107\u306b\u7f6e\u304f\u3053\u3068\u306b\u3057\u3066\u3001\u30bf\u30d7\u30eb\u306b\u3064\u3044\u3066\u5927\u3044\u306b\u8a9e\u308a\u307e\u3059\u3002\u2728<\/p>\n<h2>\u30bf\u30d7\u30eb\u3068\u306f?<\/h2>\n<p>\u30bf\u30d7\u30eb\u3068\u8a00\u3063\u3066\u3082\u3001\u30bf\u30d4\u30aa\u30ab\u306e\u89aa\u621a\u3068\u304b\u3068\u3044\u3046\u3053\u3068\u3067\u306f\u306a\u304f\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u4e16\u754c\u3067\u30bf\u30d7\u30eb\u3068\u3044\u3048\u3070\u3001<\/p>\n<blockquote><p>\u300c\u9806\u5e8f\u4ed8\u3051\u3089\u308c\u305f\u8981\u7d20\u306e\u5217\u300d<\/p><\/blockquote>\n<p>\u306e\u3053\u3068\u3092\u6307\u3057\u307e\u3059\u3002<\/p>\n<p>Scala\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<p><code>val a:(Int,String)=(3,\"\u6a2a\u6d5c\u5e02\")<\/code><\/p>\n<p>\u30bf\u30d7\u30eb\u306fList\u306b\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code>val a:List[(Int,String)]=List((3,\"\u6a2a\u6d5c\u5e02\"),(2,\"\u5ddd\u5d0e\u5e02\"),(1,\"\u76f8\u6a21\u539f\u5e02\"))<\/code><\/p>\n<p>\u6570\u5217\u3063\u307d\u3044\u3067\u3059\u306d\u3002<\/p>\n<h2>\u30bf\u30d7\u30eb\u306e\u3069\u306e\u3078\u3093\u304c\u826f\u3044\u306e\u304b?<\/h2>\n<p>Java\u3068\u306e\u6bd4\u8f03\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u30bf\u30d7\u30eb\u3092\u4f7f\u3046\u3053\u3068\u306e\u5229\u70b9\u3068\u3057\u3066\u3059\u3050\u306b\u601d\u3044\u3064\u304f\u306e\u306f\u300c3\u500b\u4ee5\u4e0a\u306e\u8981\u7d20\u304c\u4e00\u7d44\u306b\u306a\u3063\u3066\u3044\u308b\u30c7\u30fc\u30bf\u3092\u6271\u3046\u305f\u3081\u306b\u305d\u308c\u3089\u306e\u30c7\u30fc\u30bf\u5c02\u7528\u306ePOJO(Plain Old Java Object)\u3092\u66f8\u304b\u306a\u304f\u3066\u3082\u826f\u3044\u3053\u3068\u3002\u300d\u3050\u3089\u3044\u304b\u306a\u3041\u2026 \u3068\u601d\u3044\u307e\u3059\u3002\u307e\u305f\u30012\u500b\u306e\u8981\u7d20\u304c\u4e00\u7d44\u306b\u306a\u3063\u3066\u3044\u308b\u5834\u5408\u306b\u306fMap\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3059\u308b\u30af\u30e9\u30b9\u3092\u4f7f\u3063\u3066\u4f55\u3068\u304b\u3059\u308b\u65b9\u5411\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<h3>Java\u306e\u5834\u5408<\/h3>\n<p>\u3057\u304b\u3057\u3001\u3088\u30fc\u304f\u8003\u3048\u308b\u3068\u2026<\/p>\n<p>POJO\u3092\u66f8\u304f\u3068\u3044\u3046\u3053\u3068\u306f\u30af\u30e9\u30b9\u3092\u4f5c\u308b\u3053\u3068\u3067\u3042\u308a\u3001\u305d\u308c\u306b\u5bfe\u5fdc\u3057\u305f\u540d\u524d\u3084\u4f5c\u3063\u305f\u30af\u30e9\u30b9\u3092\u53ce\u5bb9\u3059\u308b\u305f\u3081\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u3092\u6c7a\u3081\u3066\u3084\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u30af\u30e9\u30b9\u306b\u5c5e\u3059\u308b\u8981\u7d20\u306b\u3064\u3044\u3066\u306f\u5bfe\u5fdc\u3059\u308b\u5909\u6570\u540d\u3082\u8003\u3048\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002\u3057\u304b\u3082\u3001\u3053\u308c\u3089\u306e\u540d\u524d\u306f\u3059\u3079\u3066\u958b\u767a\u8005\u304c\u72ec\u81ea\u306b\u6c7a\u3081\u305f\u3082\u306e\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3001\u4e8b\u3068\u6b21\u7b2c\u306b\u3088\u3063\u3066\u306f\u4ed6\u306e\u4eba\u306b\u8aac\u660e\u3092\u3059\u308b\u305f\u3081\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u66f8\u304b\u306d\u3070\u306a\u3089\u306a\u304f\u306a\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u300c2\u99c5\u9593\u306e\u99c5\u540d\u53ca\u3073\u904b\u8cc3\u306e\u30ea\u30b9\u30c8\u300d\u3092\u683c\u7d0d\u3059\u308b\u305f\u3081\u306e\u5909\u6570\u3092Java\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3092\u8003\u3048\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u6700\u521d\u306b2\u99c5\u9593\u306e\u99c5\u540d\u53ca\u3073\u904b\u8cc3\u3092\u683c\u7d0d\u3059\u308b\u305f\u3081\u306ePOJO\u3092\u5b9a\u7fa9\u3057\u3066\u3001\u305d\u306e\u30af\u30e9\u30b9\u306bFare\u307f\u305f\u3044\u306a\u30af\u30e9\u30b9\u540d\u3092\u4e0e\u3048\u3001\u305d\u306e\u30af\u30e9\u30b9\u306b\u5c5e\u3059\u308b3\u500b\u306e\u5909\u6570\u306bstation1,station2,fare\u3068\u547d\u540d\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u6b21\u306b\u3001\u30ea\u30b9\u30c8\u306b\u3064\u3044\u3066\u306fJava\u306eList\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30af\u30e9\u30b9\u3092\u7528\u3044\u3066\u3001<\/p>\n<p><code>List<Fare> fareList = new ArrayList<Fare>();<\/code><\/p>\n<p>\u3068\u30d7\u30ed\u30b0\u30e9\u30e0\u4e2d\u3067\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u306a\u304a\u3001\u4e0a\u8a18\u306e\u5909\u6570\u306e\u4e2d\u8eab\u306b\u3064\u3044\u3066\u306f\u5225\u9014Fare\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3057\u3066fareList\u306badd\u30e1\u30bd\u30c3\u30c9\u3067\u8ffd\u52a0\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u305f\u3060\u3001\u4e0a\u8a18\u306eFare\u3068\u3044\u3046\u30af\u30e9\u30b9\u306e\u5b9a\u7fa9\u3092\u4ed6\u306e\u4eba\u304c\u898b\u305f\u308a\u3001\u5f8c\u304b\u3089\u898b\u76f4\u3057\u3066\u307f\u305f\u3068\u304d\u306b\u3001\u3053\u308c\u304c\u4f55\u3092\u8868\u3057\u3066\u3044\u308b\u306e\u304b\u306f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u898b\u306a\u3044\u9650\u308a\u308f\u304b\u3089\u306a\u3044\u3068\u8003\u3048\u308b\u306e\u304c\u4e00\u822c\u7684\u306a\u3068\u3053\u308d\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u3042\u308b\u3044\u306f\u3001\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u306f\u5b9f\u306f\u4f55\u56de\u304b\u9014\u4e2d\u4e0b\u8eca\u3092\u3059\u308b\u305f\u3081\u306b\u5207\u7b26\u3092\u305d\u306e\u90fd\u5ea6\u8cb7\u3044\u306a\u304a\u3059\u3053\u3068\u306b\u306a\u308b\u5834\u5408\u306b\u3001\u6700\u3082\u5b89\u304f\u306a\u308b\u7d4c\u8def\u3092\u63a2\u3059\u305f\u3081\u306e\u30b3\u30fc\u30c9\u306e\u4e00\u90e8\u3067\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u3053\u306e\u5834\u5408\u3001Fare\u3068\u3044\u3046\u30af\u30e9\u30b9\u306f\u3042\u308b\u533a\u9593\u306e\u904b\u8cc3\u3092\u63a2\u7d22\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u5185\u90e8\u3067\u3057\u304b\u4f7f\u308f\u308c\u306a\u3044\u306e\u3067\u3001\u958b\u767a\u8005\u81ea\u8eab\u304c\u308f\u304b\u3063\u3066\u3044\u308c\u3070\u3088\u3044\u3057\u3001\u6700\u60aa\u30af\u30e9\u30b9\u306e\u4ed5\u69d8\u306b\u3064\u3044\u3066\u306f\u5fd8\u308c\u3066\u3057\u307e\u3063\u3066\u3082\u52d5\u3051\u3070\u3088\u3044\u3068\u3044\u3046\u4f4d\u7f6e\u3065\u3051\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002\u3057\u304b\u3057\u3001\u9006\u306b\u305d\u306e\u7a0b\u5ea6\u306e\u91cd\u8981\u5ea6\u3057\u304b\u6301\u305f\u306a\u3044\u30af\u30e9\u30b9\u3067\u3042\u308b\u306a\u3089\u3070\u3001\u30af\u30e9\u30b9\u3084\u5909\u6570\u306e\u540d\u524d\u3092\u6c7a\u3081\u305f\u308a\u3001POJO\u3092\u66f8\u3044\u305f\u308a\u3059\u308b\u3053\u3068\u306f\u610f\u5473\u306e\u306a\u3044\u4f5c\u696d\u306b\u601d\u3048\u307e\u3059\u3002<\/p>\n<h3>\u305d\u3053\u3067\u3001\u30bf\u30d7\u30eb\u306e\u767b\u5834\u3067\u3059\u3002<\/h3>\n<p>\u4e00\u65b9\u3001Scala\u306e\u30bf\u30d7\u30eb\u3067\u300c2\u99c5\u9593\u306e\u99c5\u540d\u53ca\u3073\u904b\u8cc3\u306e\u30ea\u30b9\u30c8\u300d\u3092\u683c\u7d0d\u3059\u308b\u305f\u3081\u306e\u5909\u6570\u3092\u5b9a\u7fa9\u3059\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u6570\u306b\u683c\u7d0d\u3059\u308b\u30c7\u30fc\u30bf\u3082\u307e\u3068\u3081\u3066\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code>val fareList : List[(String,String,Int)] = List((\"A\u99c5\",\"B\u99c5\",136),(\"A\u99c5\",\"C\u99c5\",210))<\/code><\/p>\n<p>Scala\u306eREPL\u3067\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u5b9a\u7fa9\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/pandanote.info\/?attachment_id=5438\" rel=\"attachment wp-att-5438\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pandanote.info\/wordpress\/wp-content\/uploads\/2019\/10\/scala_repl-300x80.png\" alt=\"\" width=\"300\" height=\"80\" class=\"alignnone size-medium wp-image-5438\" srcset=\"https:\/\/pandanote.info\/wordpress\/wp-content\/uploads\/2019\/10\/scala_repl-300x80.png 300w, https:\/\/pandanote.info\/wordpress\/wp-content\/uploads\/2019\/10\/scala_repl-768x205.png 768w, https:\/\/pandanote.info\/wordpress\/wp-content\/uploads\/2019\/10\/scala_repl-660x176.png 660w, https:\/\/pandanote.info\/wordpress\/wp-content\/uploads\/2019\/10\/scala_repl.png 860w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u4e0a\u8a18\u306e\u30ea\u30b9\u30c8\u306b\u3064\u3044\u3066\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u66f8\u304f\u5834\u5408\u3001\u53b3\u5bc6\u306b\u306f\u300c2\u99c5\u9593\u306e\u99c5\u540d\u53ca\u3073\u904b\u8cc3\u306e\u30bf\u30d7\u30eb\u306e\u30ea\u30b9\u30c8\u300d\u3068\u66f8\u304f\u3079\u304d\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u300c\u30bf\u30d7\u30eb\u306e\u300d\u3092\u7701\u3044\u3066\u3057\u307e\u3063\u3066\u3082(\u81ea\u7136\u8a00\u8a9e\u7684\u306b\u306f)\u610f\u5473\u306e\u3042\u308b\u6587\u7ae0\u306b\u306a\u308a\u307e\u3059\u3002\u305d\u3053\u306b\u306f\u958b\u767a\u8005\u304c\u72ec\u81ea\u306b\u6c7a\u3081\u305f\u30af\u30e9\u30b9\u540d\u306a\u3069\u306e\u30cd\u30fc\u30df\u30f3\u30b0\u304c\u5165\u308b\u4f59\u5730\u306f\u3042\u308a\u307e\u305b\u3093\u3057\u3001\u305d\u3082\u305d\u3082\u30cd\u30fc\u30df\u30f3\u30b0\u306e\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u672cWeb\u30b5\u30a4\u30c8\u306e\u7ba1\u7406\u4eba\u305f\u308bpanda\u306e\u7d4c\u9a13\u4e0a\u3001\u307e\u3068\u307e\u3063\u305f\u6a5f\u80fd\u3092\u6301\u3064\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u4f5c\u308b\u6642\u306b\u4e09\u3064\u7d44\u4ee5\u4e0a\u306e\u30c7\u30fc\u30bf\u306e\u7d44\u3092\u6271\u3046\u5b9f\u88c5\u3092\u305b\u306d\u3070\u306a\u3089\u306a\u304f\u306a\u3063\u305f\u5834\u5408\u3001\u305d\u308c\u306f1\u56de\u3067\u7d42\u308f\u308b\u3082\u306e\u3067\u306f\u306a\u304f\u3001\u5225\u306e\u7b87\u6240\u3067\u3082\u5fc5\u8981\u306b\u306a\u308b\u3053\u3068\u304c\u591a\u3044\u3088\u3046\u306b\u611f\u3058\u307e\u3059\u3002Java\u306e\u5834\u5408\u3067\u3042\u308c\u3070POJO\u3092\u4f5c\u3063\u3066\u305d\u306e\u30cd\u30fc\u30df\u30f3\u30b0\u3092\u8003\u3048\u308b\u4f5c\u696d\u306f\u77ed\u5c0f\u306a\u4f5c\u696d\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u305d\u308c\u3092\u7e70\u308a\u8fd4\u3057\u884c\u3046\u3053\u3068\u306b\u3088\u308b\u30e2\u30c1\u30d9\u30fc\u30b7\u30e7\u30f3\u306e\u4f4e\u4e0b\u3084\u3001POJO\u304c\u4e71\u7acb\u3059\u308b\u3053\u3068\u306b\u3088\u308b\u904b\u7528\u6642\u306e\u7ba1\u7406\u30b3\u30b9\u30c8\u306e\u5897\u5927\u3092\u62db\u304d\u304c\u3061\u3067\u3059\u304c\u3001\u30bf\u30d7\u30eb\u304c\u4f7f\u3048\u308bScala\u3067\u306f\u305d\u306e\u3088\u3046\u306a\u3053\u3068\u306f\u8d77\u3053\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3053\u306e\u7bc0\u306e\u6700\u521d\u306e\u65b9\u3067\u30012\u500b\u306e\u8981\u7d20\u304c\u4e00\u7d44\u306b\u306a\u3063\u3066\u3044\u308b\u5834\u5408\u306b\u306fMap\u30af\u30e9\u30b9\u3092\u4f7f\u3063\u3066\u4f55\u3068\u304b\u3059\u308b\u65b9\u5411\u306b\u306a\u308b\u3068\u66f8\u304d\u307e\u3057\u305f\u304c\u30012\u500b\u306e\u8981\u7d20\u306e\u7247\u65b9\u304ckey\u3067\u3082\u3046\u7247\u65b9\u304c\u5bfe\u5fdc\u3059\u308b\u5024(value)\u306e\u3088\u3046\u306a\u3042\u308b\u7a2e\u306e\u4e0a\u4e0b\u95a2\u4fc2\u304c\u3042\u308b\u5834\u5408\u306b\u306f\u3001Map\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3059\u308b\u30af\u30e9\u30b9\u304c\u4f7f\u3048\u307e\u3059\u3002\u3057\u304b\u3057\u30012\u500b\u306e\u8981\u7d20\u9593\u306e\u95a2\u4fc2\u304c\u5bfe\u7b49\u3067\u3042\u308b\u5834\u5408\u306b\u306fJava\u6a19\u6e96\u306e\u30af\u30e9\u30b9\u306b\u306f\u306a\u3044BiMap(guava\u306b\u3042\u308a\u307e\u3059\u3002)\u3092\u4f7f\u3046\u306a\u3069\u306e\u5bfe\u5fdc\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u8981\u7d20\u304c2\u500b\u306e\u5834\u5408\u3067\u3082\u30bf\u30d7\u30eb\u3092\u4f7f\u3063\u3066\u304a\u3044\u305f\u65b9\u304c\u3001\u8981\u7d20\u9593\u306e\u95a2\u4fc2\u3092\u6c17\u306b\u3059\u308b\u3053\u3068\u306a\u304f\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u305d\u3046\u3067\u3059\u3002<\/p>\n<h2>\u4f7f\u7528\u4f8b: A1\u5f62\u5f0f\u304b\u3089(row,cell)\u306e\u30bf\u30d7\u30eb\u3078\u306e\u5909\u63db<\/h2>\n<p>\u3053\u3053\u3067\u3001Apache POI\u3067Microsoft Excel(\u4ee5\u4e0b\u5358\u306b\u300cExcel\u300d\u3068\u66f8\u304d\u307e\u3059\u3002)\u306e\u30bb\u30eb\u306b\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u66f8\u304d\u3059\u308b\u5834\u5408\u306b\u983b\u51fa\u306eA1\u5f62\u5f0f\u304b\u3089(row,cell)\u306e\u30bf\u30d7\u30eb\u3078\u306e\u5909\u63db\u3092\u884c\u3046\u30b3\u30fc\u30c9\u3092Scala\u3067\u66f8\u304f\u3053\u3068\u3092\u8003\u3048\u307e\u3059\u3002\u306a\u304a\u3001(row,cell)\u306e\u5024\u306fApache POI\u306egetRow\u30e1\u30bd\u30c3\u30c9\u3084getCell\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u3068\u3057\u3066\u76f4\u63a5\u6307\u5b9a\u3067\u304d\u308b\u5024\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u901a\u5e38Excel\u306e\u30bb\u30eb\u306f\u5404\u5217\u306b\u4ed8\u3055\u308c\u3066\u3044\u308b\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8\u3068\u884c\u756a\u53f7\u3092\u9023\u7d50\u3057\u305f\u6587\u5b57\u5217\u3067\u8868\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u8868\u73fe\u5f62\u5f0f\u3092\u300cA1\u8868\u73fe\u5f62\u5f0f\u300d\u3068\u547c\u3076\u306e\u3060\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u300cTLV\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u300d\u3068\u540c\u3058\u304f\u3089\u3044\u306e\u5b89\u76f4\u306a\u30cd\u30fc\u30df\u30f3\u30b0\u3067\u3059\u304c\u3001\u305d\u3046\u547c\u3076\u3082\u306e\u3060\u305d\u3046\u306a\u306e\u3067\u3001\u81f4\u3057\u65b9\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>Apache POI\u306f\u6211\u304c\u56fd\ud83c\uddef\ud83c\uddf5\u3067\u306fExcel\u306e\u30bb\u30eb\u306b\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u66f8\u304d\u3059\u308b\u5834\u5408\u306b\u306f\u683c\u5225\u306b\u7d76\u5927\u306a\u5a01\u529b\u3092\u767a\u63ee\u3057\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u306fApache POI\u5185\u306bA1\u5f62\u5f0f\u304b\u3089R1C1\u5f62\u5f0f\u3078\u306e\u5909\u63db\u3001\u53ca\u3073\u305d\u306e\u9006\u306e\u5909\u63db\u3092\u884c\u3046\u30af\u30e9\u30b9\u3068\u3057\u3066CellReference\u3068\u3044\u3046\u3082\u306e\u304c\u5b58\u5728\u3057\u307e\u3059\u304c\u3001\u3053\u306e\u8a18\u4e8b\u306b\u304a\u3051\u308b\u3053\u3053\u307e\u3067\u306e\u8003\u5bdf\u306b\u3088\u308a\u30af\u30e9\u30b9\u540d\u3092\u899a\u3048\u308b\u3053\u3068\u81ea\u4f53\u306b\u4fa1\u5024\u3092\u611f\u3058\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u306e\u3067\u3001\u305d\u306e\u307e\u307eScala\u3067\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u307f\u307e\u3059\u3002Apache POI\u306fJava\u3067\u8a18\u8ff0\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001Java\u3067\u8a18\u8ff0\u3055\u308c\u3066\u3044\u308b\u3068\u3044\u3046\u3053\u3068\u306fScala\u306e\u30b3\u30fc\u30c9\u304b\u3089\u3067\u3082\u30e1\u30bd\u30c3\u30c9\u306e\u547c\u3073\u51fa\u3057\u304c\u3067\u304d\u308b\u3068\u3044\u3046\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u306b\u3088\u3063\u3066\u524d\u7f6e\u304d\u304c\u9577\u304f\u306a\u308a\u307e\u3057\u305f\u304c\u3001\u30b3\u30fc\u30c9\u4f8b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><script src=\"https:\/\/gist.github.com\/pandanote-info\/3fce90441b420fa4a6c40d47889d7bbc.js\"><\/script><\/p>\n<p>\u4e0a\u8a18\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u5909\u63db\u3055\u308c\u308b\u30bf\u30d7\u30eb\u306e\u5404\u8981\u7d20\u306b1\u3092\u52a0\u7b97\u3057\u3066\u304b\u3089\u6587\u5b57\u5217\u3092\u4f5c\u6210\u3059\u308b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u30e1\u30bd\u30c3\u30c9\u306e\u547c\u3073\u51fa\u3057\u5074\u3067\u8ffd\u52a0\u3059\u308b\u3068R1C1\u5f62\u5f0f\u306b\u5909\u63db\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><code>val r1c1 = toRowCell(c,r.toInt)<br \/>\n\"R%dC%d\".format(r1c1._1+1,r1c1._2+1)<\/code><\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u3044\u3063\u305f\u3093\u30dc\u30c4\u306b\u3057\u305f\u306f\u305a\u306e\u30cd\u30bf\u3067\u3059\u304c\u3001\u30cd\u30bf\u306e\u65b9\u5411\u6027\u3092\u3061\u3087\u3063\u3068\u5909\u3048\u305f\u4e0a\u3067\u306e\u307e\u3055\u304b\u306e\u5fa9\u6d3b\u3067\u3059\u2193<\/p>\n<blockquote class=\"twitter-tweet\">\n<p lang=\"ja\" dir=\"ltr\">Apache POI\u306bCellReference\u3068\u3044\u3046\u30af\u30e9\u30b9\u304c\u3042\u308b\u306e\u3092\u77e5\u3089\u305a\u306b\u3001 <a href=\"https:\/\/twitter.com\/hashtag\/Scala?src=hash&amp;ref_src=twsrc%5Etfw\">#Scala<\/a> \u3067A1\u5f62\u5f0f\u3068R1C1\u5f62\u5f0f\u306e\u9593\u306e\u5909\u63db\u7528\u306e\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3057\u307e\u3063\u305f\u4ef6\u3002<br \/>\u3053\u306e\u4ef6\u3067panda\u5927\u5b66\u7fd2\u5e33\u306e\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u8eca\u8f2a\u306e\u518d\u767a\u660e\u3092\u76db\u5927\u306b\u3084\u3089\u304b\u3057\u305f\u306e\u3067\u3001\u30b3\u30fc\u30c9\u81ea\u4f53\u306f\u4f7f\u3044\u307e\u3059\u304c\u3001\u8a18\u4e8b\u3068\u3057\u3066\u306f\u30dc\u30c4\u306b\u3057\u307e\u3057\u305f\u3002\ud83d\ude05<a href=\"https:\/\/twitter.com\/hashtag\/lifeinyokohama?src=hash&amp;ref_src=twsrc%5Etfw\">#lifeinyokohama<\/a><\/p>\n<p>&mdash; pandanote.info (@Pandanote_info) <a href=\"https:\/\/twitter.com\/Pandanote_info\/status\/1184937656511131649?ref_src=twsrc%5Etfw\">October 17, 2019<\/a><\/p><\/blockquote>\n<p> <script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p>Java\u3067\u66f8\u304f\u3068\u305d\u308c\u306a\u308a\u306e\u624b\u9593\u3068\u30b3\u30fc\u30c9\u91cf\u3092\u8981\u3059\u308b\u51e6\u7406\u306f\u4ed6\u306b\u3082\u30eb\u30fc\u30d7\u51e6\u7406\u754c\u9688\u3092\u59cb\u3081\u3068\u3057\u3066\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u304c\u3001\u672cWeb\u30b5\u30a4\u30c8\u306e\u7ba1\u7406\u4eba\u305f\u308bpanda\u306eScala\u529b\u306e\u90fd\u5408\u306b\u3088\u308a\u3001\u3053\u306e\u8a18\u4e8b\u3067\u306f\u30bf\u30d7\u30eb\u306b\u3064\u3044\u3066\u66f8\u3044\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u30bf\u30d7\u30eb\u3092\u4f7f\u3046\u304b\u3069\u3046\u304b\u8ff7\u3063\u305f\u6642\u306b\u306f\u3053\u306e\u8a18\u4e8b\u3092\u601d\u3044\u51fa\u3057\u3066\u3044\u305f\u3060\u3051\u308b\u3068\u5e78\u3044\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u306f\u4ee5\u4e0a\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b Scala\u3067\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u3067\u305d\u308c\u306a\u308a\u306b\u307e\u3068\u307e\u3063\u305f\u6a5f\u80fd\u304c\u5b9f\u73fe\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u5b9f\u904b\u7528\u3092\u884c\u3046\u65e5\u304c\u8fd1\u3065\u3044\u3066\u304d\u307e\u3057\u305f\u3002 Scala\u3067\u306f\u30eb\u30fc\u30d7\u51e6\u7406\u3068\u30bf\u30d7\u30eb\u3092\u3046\u307e\u304f\u4f7f\u3046\u3068\u3001Java\u3088\u308a\u3082\u304b\u306a\u308a\u52b9\u7387\u306e\u3088\u3044\u5b9f\u88c5\u304c\u3067\u304d\u307e\u3059\u3002\u304b\u3064\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u6a2a\u9577\u306b\u306a\u308a\u307e\u3059\u2193 \u307e\u305f\u3001\u51e6\u7406\u306e\u7a2e\u985e\u306b\u3088\u3063\u3066\u306f\u30b3\u30fc\u30c9\u304b\u8aad\u307f\u3084\u3059\u304f\u306a\u308b\u5834\u5408\u3055\u3048\u3042\u308a\u307e\u3059(\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3053\u306e\u70b9\u306b\u3064\u3044\u3066\u306e\u8a73\u7d30\u306f\u5272\u611b\u3057\u307e\u3059)\u3002 \u305d\u3053\u3067\u3001\u3053\u306e\u8a18\u4e8b\u3067\u306f\u30eb\u30fc\u30d7\u51e6\u7406\u306b\u3064\u3044\u2026 <span class=\"read-more\"><a href=\"https:\/\/pandanote.info\/?p=5424\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":5438,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-5424","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scala"],"_links":{"self":[{"href":"https:\/\/pandanote.info\/index.php?rest_route=\/wp\/v2\/posts\/5424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pandanote.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pandanote.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pandanote.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pandanote.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5424"}],"version-history":[{"count":17,"href":"https:\/\/pandanote.info\/index.php?rest_route=\/wp\/v2\/posts\/5424\/revisions"}],"predecessor-version":[{"id":5443,"href":"https:\/\/pandanote.info\/index.php?rest_route=\/wp\/v2\/posts\/5424\/revisions\/5443"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pandanote.info\/index.php?rest_route=\/wp\/v2\/media\/5438"}],"wp:attachment":[{"href":"https:\/\/pandanote.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pandanote.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pandanote.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}