diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2008-03-11 17:28:37 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2008-03-11 17:28:37 +0000 |
commit | cd8798cb54ad84e55e13ed2831a9512003fa7ecc (patch) | |
tree | ce0b0a92632935107e75ffc9d5797b45e71a3ba9 | |
parent | 5c1b068826d0e897b0ea3c4b77c2b8c08503f112 (diff) | |
download | jackcess-cd8798cb54ad84e55e13ed2831a9512003fa7ecc.tar.gz jackcess-cd8798cb54ad84e55e13ed2831a9512003fa7ecc.zip |
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
-rw-r--r-- | src/java/com/healthmarketscience/jackcess/Cursor.java | 16 |
1 files changed, 16 insertions, 0 deletions
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 @@ -437,6 +437,22 @@ public abstract class Cursor implements Iterable<Map<String, Object>> } /** + * Returns an Iterable whose iterator() method returns the result of a call + * to {@link #iterator(Collection<String>)} + * @throws IllegalStateException if an IOException is thrown by one of the + * operations, the actual exception will be contained within + */ + public Iterable<Map<String, Object>> iterable( + final Collection<String> columnNames) + { + return new Iterable<Map<String, Object>>() { + public Iterator<Map<String, Object>> iterator() { + return Cursor.this.iterator(columnNames); + } + }; + } + + /** * Calls <code>beforeFirst</code> on this table and returns an unmodifiable * Iterator which will iterate through all the rows of this table, returning * only the given columns. Use of the Iterator follows the same |