On the official API page, I’ve searched for “time”, but can’t find the class. I looked at all methods on RichLong and RichInt, but can’t find the methods.
I’m specifically talking about the methods that convert between int/long to some kind of rich object:
2 hours + 12 seconds
Note I’m not asking what the package is, I want to know how to find it.
Those aren’t in the standard Scala API. Are you using the scala-time wrapper for JodaTime? If so, that would tell you where to look. In general, if you know which import enables the capability, it helps a lot when trying to find documentation!
If you know a method name, you can click on the little letters at the top of the left panel, just below the search text field in ScalaDoc–this will bring up a list of everything in the docs with that name, including methods (and tell you how to find it).
If a class doesn’t have a method itself, you can use Scala to tell you what class it’s getting converted to:
So here you see that the string
"fish"does not itself have asizemethod; instead, that’s been granted by thescala.collection.immutable.StringOpsmethod. You could do the same thing to find out aboutseconds.Finally, stew’s answer is probably what you were really looking for!