001 package com.alexkasko.springjdbc.iterable; 002 003 import java.io.Closeable; 004 import java.util.Iterator; 005 006 /** 007 * Iterator, that must be closed after use 008 * 009 * @author alexkasko 010 * Date: 11/7/12 011 */ 012 public interface CloseableIterator<T> extends Iterator<T>, Closeable { 013 014 /** 015 * Closes this iterator and releases JDBC resources associated 016 * with it. If the iterator is already closed then invoking this 017 * method has no effect. 018 */ 019 void close(); 020 021 /** 022 * @return whether iterator was closed 023 */ 024 boolean isClosed(); 025 }