Re: Java help
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>) |