Lovely library, but I ran into a problem because I was expecting Point2D and Vector2D hashcodes to depend only on the x and y values (ie, I expected new Vector2D(1,1).hashCode() == new Vector2D(1, 1).hashCode(), which isn't the case).
Since it's customary to override .hashCode when you override .equals, could you implement hashCode on these classes?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
sure, hashCode has to be implemented that way!
I started writing the libray years aga, and was not yet aware of this. I will fix it.
By the way, I have moved the repository to GitHub (and to the Git versioning system), making it more easy to manage: https://github.com/dlegland/javaGeom
regards,
David
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Lovely library, but I ran into a problem because I was expecting Point2D and Vector2D hashcodes to depend only on the x and y values (ie, I expected new Vector2D(1,1).hashCode() == new Vector2D(1, 1).hashCode(), which isn't the case).
Since it's customary to override .hashCode when you override .equals, could you implement hashCode on these classes?
sure, hashCode has to be implemented that way!
I started writing the libray years aga, and was not yet aware of this. I will fix it.
By the way, I have moved the repository to GitHub (and to the Git versioning system), making it more easy to manage: https://github.com/dlegland/javaGeom
regards,
David