View Single Post
  #2 (permalink)  
Old 07-24-2007, 02:03 PM
shanePreater shanePreater is offline
Member
 
Join Date: Jul 2007
Location: England, Bath
Posts: 47
shanePreater is on a distinguished road
I think you have slightly misunderstood the iterator method as this is not on the Iterator interface but is actually on the Collections which use the iterator.

When obtaining an iterator from a Collection you would call the iterator() method which gives you an iterator of the correct type.

In order to use your own iterator for your collection you would tend to implement the Collection interface (or simply extend an existing one) and then override the iterator method to return your custom version.

You could then chuck your objects into your custom collection and acquire the iterator and voila.

Hope this helps.
__________________
Shane Preater -
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote