Hello,
On Tue, 28 Sep 2004 12:47:55 +0200
Markus Schaber <[EMAIL PROTECTED]> wrote:
> > static double loopLinkedList() {
> > long before = System.currentTimeMillis();
> > ListIterator litcc;
> > for(int i = 0; i < RUN_LENGTH; i++) {
> > litcc = llhead;
> > while(litcc.hasNext()) {
> > tmp = (String) litcc.next(); <---- WE NEVER GET HERE
> > }
> > }
>
> Thats not exactly right. It is called during the first run of the
> RUN_LENGTH loop, then hasNext() always is false because the old
> ListIterator is used again.
Sorry, forget this, you're fully right.
The reason is:
> ll = new LinkedList();
> litcc = ll.listIterator(0);
> llhead = litcc;
> litcc.add("aaa");
> litcc.add("bbb");
> litcc.add("ccc");
> litcc.add("ddd");
> litcc.add("eee");
So the ListIterator is for the empty list, and hasNext() is always
false.
Sorry for my bullshit,
Markus
--
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 z�rich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:[EMAIL PROTECTED] | www.logi-track.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]