Index: src/java/org/apache/poi/ss/usermodel/Workbook.java =================================================================== --- src/java/org/apache/poi/ss/usermodel/Workbook.java (revision 1696016) +++ src/java/org/apache/poi/ss/usermodel/Workbook.java (working copy) @@ -20,10 +20,12 @@ import java.io.Closeable; import java.io.IOException; import java.io.OutputStream; +import java.util.Iterator; import java.util.List; import org.apache.poi.ss.formula.udf.UDFFinder; import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; +import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.util.CellRangeAddress; /** @@ -31,7 +33,7 @@ * will construct whether they are reading or writing a workbook. It is also the * top level object for creating new sheets/etc. */ -public interface Workbook extends Closeable { +public interface Workbook extends Closeable, Iterable { /** Extended windows meta file */ public static final int PICTURE_TYPE_EMF = 2; @@ -360,6 +362,16 @@ void close() throws IOException; /** + * Allows foreach loops: + *

+     * for(Sheet sheet : wb ) {
+     *
+     * }
+     * 
+ */ + Iterator iterator(); + + /** * @return the total number of defined names in this workbook */ int getNumberOfNames();