• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Removing Duplicate Objects from Combined Arrays?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Removing Duplicate Objects from Combined Arrays? (From: Janice Cheung <email@hidden>)

  • Prev by Date: Re: When (not) to use session().defaultEditingContext()
  • Next by Date: Re: WORadioButton seems not to accept onChange JS test ?
  • Previous by thread: Re: Removing Duplicate Objects from Combined Arrays?
  • Next by thread: Databse connection keep alive
  • Index(es):
    • Date
    • Thread