Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Scala's Comparable trait?

I am searching for Scala counterpart of C# IComparable, and I found Comparable trait. I mean -- Comparable is mentioned, but when I search for it at http://www.scala-lang.org/api/current/scala/ I get 0 hits. Because of the name, using Google I get a lot of "how Scala is comparable to..." results.

Is there any resource I could read about this mysterious Comparable thing? After all Ordered extends it, so it has to exist.

like image 767
greenoldman Avatar asked Oct 09 '11 09:10

greenoldman


1 Answers

The Comparable that you saw mentioned must have been java.lang.Comparable. There is no trait named Comparable in Scala stdlib. Scala's Ordered trait extends java.lang.Comparable.

like image 177
missingfaktor Avatar answered Oct 25 '22 18:10

missingfaktor