Hello,
I want to construct a list of pairs without dupliactes, not the key
value pairs, I just want to ensure that the pair (not ordered) is not
dupliacted in the list.
for example
method input: (3, 4), (5, 6), (4, 3), (6, 5)
method output: (3, 4), (5, 6).
I can do this manually, but is there any utility in the java language
itself ?
Bluedoze
Leon - 27 Jun 2005 15:22 GMT
Hi,
> I want to construct a list of pairs without dupliactes, not the key
> value pairs, I just want to ensure that the pair (not ordered) is not
[quoted text clipped - 5 lines]
>
> method output: (3, 4), (5, 6).
Define your own pair-class, including an equals-method (and hash-method). Then
declare a (Hash)Set.
Greetings, Leon.