public abstract class RowFilter extends Object implements Predicate<Row>
apply(Iterable)
method to create an Iterable over a
table which returns only rows matching some criteria.Constructor and Description |
---|
RowFilter() |
Modifier and Type | Method and Description |
---|---|
Iterable<Row> |
apply(Iterable<? extends Row> iterable)
Returns an iterable which filters the given iterable based on this
filter.
|
static Iterable<Row> |
apply(RowFilter rowFilter,
Iterable<? extends Row> iterable)
Returns an iterable which filters the given iterable based on the given
rowFilter.
|
Stream<Row> |
filter(Iterable<? extends Row> iterable)
Convenience method to apply this filter to the given iterable and return
it as a Stream.
|
static RowFilter |
invert(RowFilter filter)
Creates a filter which inverts the sense of the given filter (rows which
are matched by the given filter will not be matched by the returned
filter, and vice versa).
|
abstract boolean |
matches(Row row)
Returns
true if the given table row matches the Filter criteria,
false otherwise. |
static RowFilter |
matchPattern(Column columnPattern,
Object valuePattern)
Creates a filter based on a single value row pattern.
|
static RowFilter |
matchPattern(Map<String,?> rowPattern)
Creates a filter based on a row pattern.
|
boolean |
test(Row row)
Adaptation of this class for
Predicate support. |
public abstract boolean matches(Row row)
true
if the given table row matches the Filter criteria,
false
otherwise.row
- current row to test for inclusion in the filterpublic boolean test(Row row)
Predicate
support. Uses the
matches(com.healthmarketscience.jackcess.Row)
method.public Iterable<Row> apply(Iterable<? extends Row> iterable)
iterable
- row iterable to filterpublic Stream<Row> filter(Iterable<? extends Row> iterable)
public static RowFilter matchPattern(Map<String,?> rowPattern)
rowPattern
- Map from column names to the values to be matched.
A table row will match the target if
Objects.equals(rowPattern.get(s), row.get(s))
for all column names in the pattern map.public static RowFilter matchPattern(Column columnPattern, Object valuePattern)
columnPattern
- column to be matchedvaluePattern
- value to be matched.
A table row will match the target if
Objects.equals(valuePattern, row.get(columnPattern.getName()))
.public static RowFilter invert(RowFilter filter)
filter
- filter which to invertpublic static Iterable<Row> apply(RowFilter rowFilter, Iterable<? extends Row> iterable)
rowFilter
- the filter criteria, may be null
iterable
- row iterable to filternull
filter was given)Copyright © 2005–2024 OpenHMS. All rights reserved.