I was wondering if anyone can help me with providing options for double and floating precision for the class, please?
I work with Java3D and the API specification for Point3d and Point3f, I understand that the implementation effectively duplicates the Point3f class, replacing the float with two if necessary. Is this because Generics cannot be used with primitive data types? Efficiency?
I am writing a Curve class, and I am wondering if I should provide Curved and Curvef in a similar way. This is the best variant?
Yes, unfortunately, Java generics do not work with primitive types.
, java .
Java 8 , IntFunction. .
IntFunction
, - . Object, Double Float ( ).
Object
Double
Float
Curve , double/float. , doubleValue() floatValue(). , , . , Curve, , .
Curve
doubleValue()
floatValue()