Two Key HashSet?
- by athena
I need a HashSet implementation where the elements are a pair of Integers
eg. Set s = { {1,2} , {3,4} , {1,4}}. Here the set s has 3 elements.
This kind of two key HashSet is needed in many situations like, I have a relation in my database where the candidate key is a combination of two columns.
Is there some library which already provides this?
If no such implementation is available, then rather then implementing the entire data structure from scratch, will it be easier (and efficient?) to extend the HashSet implementation in Java?