Newbie: iterating two collections



I have two ArrayLists: List<Boolean> A and List<T> B with same size. I
want something like
for (int i =0; i < A.size(); i++) { B[i].booleanValue =
A[i].booleanValue); }. Just one to one value set. I am pretty new to
iterators. Can I use foreach in java for that? Any decent approach
instead of nested loops?

.



Relevant Pages

  • Re: Newbie: iterating two collections
    ... Can I use foreach in java for that? ... Any decent approach ... times when the new iterator syntax is a bit awkward. ... you will need Iterators for more general ...
    (comp.lang.java.programmer)
  • Re: How to make mod_lisp faster than php?
    ... I suspect, some big Scheme systems have decent ... > libraries for graphics or the internet, while for Java you often need ... This particular sink, HTTP support, has been included since ...
    (comp.lang.lisp)
  • Re: [PHP] RecursiveArrayIterator
    ... well garbage collection will remove the copy of an array created by foreach, ... Foreach doesn't bother creating a copy of the array either. ... about arrays and if you're using iterators then you're also talking ...
    (php.general)
  • Re: Community Experience With Iterators vs Overwriting
    ... a large library where half the methods work on IEnumerable ... Also with typing foreach and press tab, you can do a iterator very quickly. ... With the common snippet over foreach, with the old snippet started with ... Iterators and would like to use them more often than not. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: iterators
    ... {public boolean IsAvailable(){... ... It gets more complicated than that if you consider different classes of iterators (ListIterators in Java for example, or Random Access Iterators in C++) ...
    (comp.lang.java.programmer)