diff options
Diffstat (limited to 'subprojects/store-query/src/main/java/tools/refinery/store/query/EmptyResultSet.java')
-rw-r--r-- | subprojects/store-query/src/main/java/tools/refinery/store/query/EmptyResultSet.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/subprojects/store-query/src/main/java/tools/refinery/store/query/EmptyResultSet.java b/subprojects/store-query/src/main/java/tools/refinery/store/query/EmptyResultSet.java index 9ff6df26..9af73bdd 100644 --- a/subprojects/store-query/src/main/java/tools/refinery/store/query/EmptyResultSet.java +++ b/subprojects/store-query/src/main/java/tools/refinery/store/query/EmptyResultSet.java | |||
@@ -2,21 +2,33 @@ package tools.refinery.store.query; | |||
2 | 2 | ||
3 | import tools.refinery.store.map.Cursor; | 3 | import tools.refinery.store.map.Cursor; |
4 | import tools.refinery.store.map.Cursors; | 4 | import tools.refinery.store.map.Cursors; |
5 | import tools.refinery.store.query.dnf.Query; | ||
5 | import tools.refinery.store.tuple.TupleLike; | 6 | import tools.refinery.store.tuple.TupleLike; |
6 | 7 | ||
7 | public class EmptyResultSet implements ResultSet { | 8 | public record EmptyResultSet<T>(ModelQueryAdapter adapter, Query<T> query) implements ResultSet<T> { |
8 | @Override | 9 | @Override |
9 | public boolean hasResult(TupleLike parameters) { | 10 | public ModelQueryAdapter getAdapter() { |
10 | return false; | 11 | return adapter; |
11 | } | 12 | } |
12 | 13 | ||
13 | @Override | 14 | @Override |
14 | public Cursor<TupleLike, Boolean> allResults() { | 15 | public Query<T> getQuery() { |
16 | return query; | ||
17 | } | ||
18 | |||
19 | @Override | ||
20 | public T get(TupleLike parameters) { | ||
21 | return query.defaultValue(); | ||
22 | } | ||
23 | |||
24 | |||
25 | @Override | ||
26 | public Cursor<TupleLike, T> getAll() { | ||
15 | return Cursors.empty(); | 27 | return Cursors.empty(); |
16 | } | 28 | } |
17 | 29 | ||
18 | @Override | 30 | @Override |
19 | public int countResults() { | 31 | public int size() { |
20 | return 0; | 32 | return 0; |
21 | } | 33 | } |
22 | } | 34 | } |