|
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.
|