Scala has 2 double precision numbers, one AnyVal , the other AnyRef . On the JVM, they are mapped to a primitive double and class java.lang.Double respectively.
Now, what happens on platforms other than the JVM? I can use Scala.Double for the primitive, but how can I indicate that I want a Double insert reference without specifying java.lang.Double ?
[The context is on the left to understand the response of Thomas, but not the fundamental problem.
I have a Double that I want to insert using Spring into the Wicket component:
class MyPanel(id: String) extends Panel(id) { @SpringBean(name="rxAlarmLimitDb") var alarmLimitDb: Double = _
If I specify the type as Scala.Double , as indicated above, the injector fails because it can only inject objects.
If I specify java.lang.Double as the field type, everything is fine
class MyPanel(id: String) extends Panel(id) { @SpringBean(name="rxAlarmLimitDb") var alarmLimitDb: java.lang.Double = _
But I'm trying to reduce my dependency on rejecting the Java API, so how can I imagine a double in a box without it? ]
Duncan mcgregor
source share