Two Key HashSet?

Posted by athena on Stack Overflow See other posts from Stack Overflow or by athena
Published on 2010-04-10T10:12:01Z Indexed on 2010/04/10 10:23 UTC
Read the original article Hit count: 516

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about java

Related posts about hashset