diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2020-06-27 05:04:14 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2020-06-27 05:04:14 +0000 |
commit | 9e0b8076837b25886b48fef3c6b8e7aa9e5bfba8 (patch) | |
tree | 6a9096210fc791e0f67b4dc5a369a0f5749ca1d7 /src/main/java/com/healthmarketscience/jackcess/Cursor.java | |
parent | 319d51ee1ba9a0004e9fc7257ebd534bbd412eec (diff) | |
download | jackcess-9e0b8076837b25886b48fef3c6b8e7aa9e5bfba8.tar.gz jackcess-9e0b8076837b25886b48fef3c6b8e7aa9e5bfba8.zip |
Add support for using Predicates to match values in Cursors. Add PatternColumnPredicate for searching with various pattern syntaxes
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@1328 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/main/java/com/healthmarketscience/jackcess/Cursor.java')
-rw-r--r-- | src/main/java/com/healthmarketscience/jackcess/Cursor.java | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/Cursor.java b/src/main/java/com/healthmarketscience/jackcess/Cursor.java index 89fec96..0573591 100644 --- a/src/main/java/com/healthmarketscience/jackcess/Cursor.java +++ b/src/main/java/com/healthmarketscience/jackcess/Cursor.java @@ -253,7 +253,10 @@ public interface Cursor extends Iterable<Row> * @param columnPattern column from the table for this cursor which is being * matched by the valuePattern * @param valuePattern value which is equal to the corresponding value in - * the matched row + * the matched row. If this object is an instance of + * {@link java.util.function.Predicate}, it will be + * applied to the potential row value instead + * (overriding any configured ColumnMatcher) * @return {@code true} if a valid row was found with the given value, * {@code false} if no row was found */ @@ -269,7 +272,10 @@ public interface Cursor extends Iterable<Row> * @param columnPattern column from the table for this cursor which is being * matched by the valuePattern * @param valuePattern value which is equal to the corresponding value in - * the matched row + * the matched row. If this object is an instance of + * {@link java.util.function.Predicate}, it will be + * applied to the potential row value instead + * (overriding any configured ColumnMatcher) * @return {@code true} if a valid row was found with the given value, * {@code false} if no row was found */ @@ -286,7 +292,10 @@ public interface Cursor extends Iterable<Row> * the Table (you cannot use it to find successive matches). * * @param rowPattern column names and values which must be equal to the - * corresponding values in the matched row + * corresponding values in the matched row. If a value is + * an instance of {@link java.util.function.Predicate}, it + * will be applied to the potential row value instead + * (overriding any configured ColumnMatcher) * @return {@code true} if a valid row was found with the given values, * {@code false} if no row was found */ @@ -299,7 +308,10 @@ public interface Cursor extends Iterable<Row> * is restored to its previous state. * * @param rowPattern column names and values which must be equal to the - * corresponding values in the matched row + * corresponding values in the matched row. If a value is + * an instance of {@link java.util.function.Predicate}, it + * will be applied to the potential row value instead + * (overriding any configured ColumnMatcher) * @return {@code true} if a valid row was found with the given values, * {@code false} if no row was found */ @@ -309,8 +321,11 @@ public interface Cursor extends Iterable<Row> * Returns {@code true} if the current row matches the given pattern. * @param columnPattern column from the table for this cursor which is being * matched by the valuePattern - * @param valuePattern value which is tested for equality with the - * corresponding value in the current row + * @param valuePattern value which is equal to the corresponding value in + * the matched row. If this object is an instance of + * {@link java.util.function.Predicate}, it will be + * applied to the potential row value instead + * (overriding any configured ColumnMatcher) */ public boolean currentRowMatches(Column columnPattern, Object valuePattern) throws IOException; @@ -318,7 +333,10 @@ public interface Cursor extends Iterable<Row> /** * Returns {@code true} if the current row matches the given pattern. * @param rowPattern column names and values which must be equal to the - * corresponding values in the current row + * corresponding values in the matched row. If a value is + * an instance of {@link java.util.function.Predicate}, it + * will be applied to the potential row value instead + * (overriding any configured ColumnMatcher) */ public boolean currentRowMatches(Map<String,?> rowPattern) throws IOException; |