From: James Ahlborn Date: Tue, 11 Mar 2008 17:28:37 +0000 (+0000) Subject: add method for creating Iterable given specific column names X-Git-Tag: rel_1_1_13~27 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cd8798cb54ad84e55e13ed2831a9512003fa7ecc;p=jackcess.git add method for creating Iterable given specific column names git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@265 f203690c-595d-4dc9-a70b-905162fa7fd2 --- diff --git a/src/java/com/healthmarketscience/jackcess/Cursor.java b/src/java/com/healthmarketscience/jackcess/Cursor.java index 0b7f1b8..1e6ce52 100644 --- a/src/java/com/healthmarketscience/jackcess/Cursor.java +++ b/src/java/com/healthmarketscience/jackcess/Cursor.java @@ -436,6 +436,22 @@ public abstract class Cursor implements Iterable> return iterator(null); } + /** + * Returns an Iterable whose iterator() method returns the result of a call + * to {@link #iterator(Collection)} + * @throws IllegalStateException if an IOException is thrown by one of the + * operations, the actual exception will be contained within + */ + public Iterable> iterable( + final Collection columnNames) + { + return new Iterable>() { + public Iterator> iterator() { + return Cursor.this.iterator(columnNames); + } + }; + } + /** * Calls beforeFirst on this table and returns an unmodifiable * Iterator which will iterate through all the rows of this table, returning