I was wondering could anyone help me with providing options for both double and float precision for a class please?
I am working with Java3D and from the API specification for Point3d and Point3f, it is my understanding that the implementation effectively duplicates the Point3f class replacing float with double where necessary. Is this because Generics cannot be used with primitive data types? Efficiency?
I am writing a Curve class and am wondering should I provide Curved and Curvef in a similar fashion. Is this the best option?
Yes, unfortunately Java generics doesn't work on primitive types.
You could do code generation though, producing multiple java files from one template.
Java 8 is going to introduce a lot of specialized primitive versions of functional interfaces, like IntFunction
. It's going to be quite ugly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With