Is there a \"computationally\" quick way to get the count of an iterator?
int i = 0; for ( ; some_iterator.hasNext() ; ++i ) some_iterator.next();
Your code will give you an exception when you reach the end of the iterator. You could do:
int i = 0; while(iterator.hasNext()) { i++; iterator.next(); }
If you had access to the underlying collection, you would be able to call coll.size()...
coll.size()
EDIT OK you have amended...