I am doing some computation in Java and it worked fine but I noticed my numbers were slightly off from my python implementation. It took me like an entire day but I believe this is due to me having to cast my data to INT to use point. I am very new so I could be wrong but I read in the java docs that it seems to accept ints only (perhaps I misunderstood it). The reason I really liked point was because my data was in a similar format and I did not want duplicates. Data format example: (1,0), (1,2),(10,2),etc..
I guess my two questions are:
- Is there a way to get point to accept doubles? or is it going to be really difficult for a beginner to do?
- If its not possible, are there any alternative data structures I can use to achieve the same thing(thought of hash map but I thought it would replace (1,0) with (1,1) which my program would consider unique)?
Pointis mainly for GUI purposes where you have integer pixel values. Try Point2D.Double instead.