{"width":"100%","type":"rich","provider_name":"Hatena Blog","height":"190","published":"2009-11-15 00:00:02","categories":["software"],"description":"Ordered trait \u3092\u7d99\u627f(or Mix-in)\u3059\u308b\u3068 compare \u3092\u5b9a\u7fa9\u3059\u308b\u3060\u3051\u3067 = \u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u3002 class Sample(msgIn:String) extends Ordered[Sample] { val msg = msgIn def compare(that: Sample) = this.msg.toInt - that.msg.toInt } val s1 = new Sample(\"1\") val s2 = new Sample(\"2\") println((s1 < s2)) Ruby \u306e Enumerable \u3067 each \u3092\u5b9f\u88c5\u3057\u3068\u3051\u3070\u30fb\u30fb\u30fb\u3068\u540c\u3058\u2026","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.basyura.org%2Fentry%2F20091115%2Fp3\" title=\" Ordered trait - basyura&#39;s blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"basyura's blog","author_name":"basyura","image_url":null,"provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/basyura/","blog_url":"https://blog.basyura.org/","title":" Ordered trait","url":"https://blog.basyura.org/entry/20091115/p3","version":"1.0"}