Re: Removing Duplicate Objects from Combined Arrays?
Re: Removing Duplicate Objects from Combined Arrays?
- Subject: Re: Removing Duplicate Objects from Combined Arrays?
- From: Kaj Hejer <email@hidden>
- Date: Fri, 29 Oct 2004 23:11:02 +0200
On 20. okt 2004, at 20.31, Janice Cheung wrote:
Greetings!
I have a question concerning removing duplicate objects from
two (combined) arrays:
Hi!
We do something similar to this and we also use Sets for this (not
NSSet but HashSet, I'm not sure if that matters)
Our code which so far seems to work ok:
List l1 = Arrays.asList(questionsFromQText.objects());
List l2 = Arrays.asList(questionsFromAText.objects());
HashSet hs = new HashSet();
hs.addAll(l1);
hs.addAll(l2);
questions = new NSArray(hs.toArray());
-Kaj :)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden