| An iterator which should be closed after use. Some iterators take up resources which
should be free'd as soon as possible, eg large structures which can be discarded
early, or external resources such as database cursors.
Users of ClosableIterators (and thus of ExtendedIterator) should close the iterator
when they are done with it, whether because they have found a desired element
or because they have reached the end. If they do not, resources may leak or be
reclaimed unpredictably or much later than convenient.
Implementors are encouraged to dispose of resources as soon as is convenient.
author: bwm version: $Id: ClosableIterator.java,v 1.11 2008/01/02 12:07:35 andy_seaborne Exp $ |