pro_jsp thread: basic problem .. vector HELPppppppppppppppp
I suggest you replace the Vector with an ArrayList. ArrayList is a lot
faster (I timed it at 3 times as fast in one application which handled a
collection of 1500 items, others have reported similar or larger
differences).
Using an ArrayList, you can also easily get an Iterator on it
(ArrayList.iterator()), so you can just loop through it with
Item item=null;
while (iterator.hasnext())
{
item = (Item) iterator.next();
}
-----Original Message-----
From: Preeti [mailto:preetisikri@h...]
Sent: 02 March 2001 21:01
To: Pro_JavaServer_Pages
Cc: javacertstudy@y...; jcertification@y...;
Beginning Java; A mailing list about Java Server Pages specification and
reference; AJUG-SCPJava2@y...
Subject: [pro_jsp] basic problem .. vector HELPppppppppppppppp
Hi guys Actually I'm stucked with a vector problem actually I have a
vector in I have stored some id's now I want to take those id's 1 by 1out
and wanna store them into a variable how will I do that ...... Like right
now I hae a fuction for adding a id to vector but I do not have a function
to retirve those id's and placing them into a var .. for adding I have
something like : public Vector addtocart(int id) { if(id > 0) {
list.addElement(new Integer(id)); } return list; } now I wanna retrive those
id something like this int newid = take out id from vector ; pls tell me how
to do this Thanks in advance Regards Preeti --- You are currently subscribed
to pro_jsp as: jwenting@h...
$subst('Email.Unsub')