-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
5.0
-
x86
-
linux
A DESCRIPTION OF THE REQUEST :
Java sets & maps currently don't take "equality tests" as arguments to their constructors. We do this sort of thing in Scheme and ML all the time, and it's really useful.
JUSTIFICATION :
I am working on a project where this would come in handy. As java is now, I need to create different kinds of objects that all contain the same information but which implement different equals() functions. I know that inheritance solves this problem, but it's a little overkill when I only need the different behavior for a single hashtable.
Java sets & maps currently don't take "equality tests" as arguments to their constructors. We do this sort of thing in Scheme and ML all the time, and it's really useful.
JUSTIFICATION :
I am working on a project where this would come in handy. As java is now, I need to create different kinds of objects that all contain the same information but which implement different equals() functions. I know that inheritance solves this problem, but it's a little overkill when I only need the different behavior for a single hashtable.
- duplicates
-
JDK-4269596 (coll) Wanted: A way to customize the equals/hashCode algorithm
-
- Closed
-