Answer inline:

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Geir Magnusson Jr.
> 
> ........
>
> > > sorry?
> > 
> > Now you cache what Iterator you got per Iterator object but it would be
> > more efficient to cache it per listObject's class (listObject being the
> > object to iterate trough in the #foreach).
> 
> Nooo.... I don't think so.  I think I cache the class and type.
> 
>             /*
>              *  if we did figure it out, cache it
>              */
> 
>             if ( type != UNKNOWN )
>             {
>                 icd = new IntrospectionCacheData();
>                 icd.thingy = new Integer( type );
>                 icd.contextData = c;
>                 context.icachePut( this, icd );
>             }

Yes but "this", the Foreach object, is the key. It would be more efficient
to have the iterated object's class being the key. You always get the same 
iterator a given iterated object class.
 
> > 
> > >...
> > >
> > > > That is a case where I would be better served with an Iterator as
> > > > argument for the #foreach, since an Iterator over a ResultSet is so
> > > > easy to implement.
> > > > =:o)
> > >
> > > I thought I had you above, but I seem to have lost you again : an
> > > Iterator is used in the foreach.  I am cleaning up getIterator() a
> > > little as per your's and Jeff's suggestions...
> > 
> > Yes, you get Iterator's from object arrays, Collection's and Map's ...
> > ...but what happens if the object to iterate trough in the #foreach is
> > _already_ an Iterator???
> 
> ah!  yep.  good one.

Thanks!
=:o)
 
 
> > > > Have fun,
> > > > Paulo
> > >
> > > Always do!
> > >
> > > geir
> > 
> > Doing my best to have it here too,
> > =:o)
> 
> *Thrilled* to hear it. :)
> 
> geir

=:o)
Paulo

Reply via email to