greenoldman
greenoldman

Reputation: 21072

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.

Upvotes: 9

Views: 12256

Answers (1)

missingfaktor
missingfaktor

Reputation: 92056

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.

Upvotes: 18

Related Questions