Re: Offtopic: Quick Java programming question...

2000-05-23 Thread Jim Preston
new Vector(); Hashtable ht = new Hashtable(); ht.put("A", "Stuff A"); ht.put("B", "Stuff B"); stuff.add(0, ht); return stuff.toArray(); } Object[] hashArray = getStuff(); for (int idx=0; idx To: <[EMAIL PROTECTED]> Sent: Wednesday, May 17, 2

Re: Offtopic: Quick Java programming question...

2000-05-22 Thread Arun Thomas
ailing list about Java Server Pages specification and reference > [mailto:[EMAIL PROTECTED]]On Behalf Of Robert Nicholson > Sent: Wednesday, May 17, 2000 11:19 AM > To: [EMAIL PROTECTED] > Subject: Re: Offtopic: Quick Java programming question... > > > What does this do? > >

Re: Offtopic: Quick Java programming question...

2000-05-17 Thread Shawn McKisson
r v) { Hashtable[] h = null; if (v != null) { h = new Hashtable[v.size()]; v.copyInto(h); } return h; } } - Original Message - From: Scott Costa <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 17, 2000 12:15 PM Subject: Offtopic: Quick Ja

Re: Offtopic: Quick Java programming question...

2000-05-17 Thread Robert Nicholson
Are you sure? - Original Message - From: "Danny Trieu" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 17, 2000 2:21 PM Subject: Re: Offtopic: Quick Java programming question... > no can't do that > > toArray() return O

Re: Offtopic: Quick Java programming question...

2000-05-17 Thread Suresh Potiny
> > - Original Message - > > From: "Scott Costa" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Wednesday, May 17, 2000 10:15 AM > > Subject: Offtopic: Quick Java programming question... > > > > > I'm trying t

Re: Offtopic: Quick Java programming question...

2000-05-17 Thread Osvaldo Pinali Doederlein
Oops. I actually wanted to type this: -- And the following is even faster (by a hair): Hashtable ret = new Hashtable[stuff.size()]; stuff.toArray(ret); return ret; because you avoid the evil typecheck. === To u

Re: Offtopic: Quick Java programming question...

2000-05-17 Thread Danny Trieu
TECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, May 17, 2000 10:15 AM > Subject: Offtopic: Quick Java programming question... > > > I'm trying to write a method which returns an array of Hashtables, and in > > the method, I am assembling the data as a vector, a

Re: Offtopic: Quick Java programming question...

2000-05-17 Thread Scott Costa
t Costa" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, May 17, 2000 10:15 AM > Subject: Offtopic: Quick Java programming question... > > > I'm trying to write a method which returns an array of Hashtables, and in > > the method, I am as

Re: Offtopic: Quick Java programming question...

2000-05-17 Thread Osvaldo Pinali Doederlein
From: "Bip Thelin" <[EMAIL PROTECTED]> > Try exchange "return (Hashtable[]) stuff.toArray()" with: > "return (Hashtable[]) stuff.toArray(new Hashtable[0])" It should do the trick. This is more efficient: return (Hashtable[]) stuff.toArray(new Hashtable[stuff.size()]); because the data will be p

Re: Offtopic: Quick Java programming question...

2000-05-17 Thread Gocin.com
()]; stuff.copyInto(hashArray); return hashArray; Good luck, Jason B. >- Original Message - >From: "Scott Costa" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Wednesday, May 17, 2000 10:15 AM >Subject: Offtopic: Quick Java programming question... >

Re: Offtopic: Quick Java programming question...

2000-05-17 Thread Zaina Ajakie
it casts the objects into hashtable array ojects... -Original Message- From: Robert Nicholson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 17, 2000 2:19 PM To: [EMAIL PROTECTED] Subject: Re: Offtopic: Quick Java programming question... What does this do? return (HashTable

Re: Offtopic: Quick Java programming question...

2000-05-17 Thread Robert Nicholson
What does this do? return (HashTable[])stuff.toArray(new HashTable[0]); - Original Message - From: "Scott Costa" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 17, 2000 10:15 AM Subject: Offtopic: Quick Java programming question... > I&#

Re: Offtopic: Quick Java programming question...

2000-05-17 Thread Bip Thelin
> private Hashtable[] getStuff() { > Vector stuff = new Vector(); > Hashtable ht = new Hashtable(); > ht.put("A", "Stuff A"); > ht.put("B", "Stuff B"); > stuff.add(0, ht); > return (Hashtable[]) stuff.toArray(); > } Try exchange "return (Hashtable[]) stuff.toArray()" with: "return (Ha

Offtopic: Quick Java programming question...

2000-05-17 Thread Scott Costa
I'm trying to write a method which returns an array of Hashtables, and in the method, I am assembling the data as a vector, and trying to user "toArray()" to return the data as an array. Something like this: private Hashtable[] getStuff() { Vector stuff = new Vector(); Hashtable ht = new Hash