T
toton
Hi,
I have a collection class (say ArrayList) which stores values. A
separate class Session holds the array list reference. I want the
session class to return a pair of iterator for the ArrayList for
iteration purpose (say from example 50 to 60 index only). And also want
the foreach loop to run over this range of iterators only. (Or may be a
single iterator, like all other Java iterators which has a hasNext ends
at the end index) . How to do it?
Also I want two type of iterators for the list (one will return a C++
like const_iterator where modification is not possible, I am not sure
If it at all can be done, as it needs something like returning final
reference, and one non const iterator.).
Any help is appreciated.
I have a collection class (say ArrayList) which stores values. A
separate class Session holds the array list reference. I want the
session class to return a pair of iterator for the ArrayList for
iteration purpose (say from example 50 to 60 index only). And also want
the foreach loop to run over this range of iterators only. (Or may be a
single iterator, like all other Java iterators which has a hasNext ends
at the end index) . How to do it?
Also I want two type of iterators for the list (one will return a C++
like const_iterator where modification is not possible, I am not sure
If it at all can be done, as it needs something like returning final
reference, and one non const iterator.).
Any help is appreciated.