• 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: Java help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java help


  • Subject: Re: Java help
  • From: Florijan Stamenkovic <email@hidden>
  • Date: Sat, 27 Aug 2005 13:56:18 +0200

Hi, is there a method to fill an Array with sequential numbers?

I can do a simple loop with addObject istance, but there is another method?
Thanks




A bit faster approach would be to first create a normal array, and then create an NSArray from it. That way you don't get the overhead of NSMutableArray expanding when you keep adding objects, if that is what you were worried about (n case of very long sequences).


public NSArray fillArray(int count) { Object[] temp = new Number[count]; for(int i = 0; i < count ; i++) temp[i] = new Integer(_formulaForNumberGeneration(i)); return new NSArray(temp); }

_______________________________________________
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: 
 >Java help (From: Amedeo Mantica <email@hidden>)

  • Prev by Date: Re: Java help
  • Next by Date: Any issues with installing Java 5.0?
  • Previous by thread: Re: Java help
  • Next by thread: Any issues with installing Java 5.0?
  • Index(es):
    • Date
    • Thread