diff options
Diffstat (limited to 'subprojects/store-query')
-rw-r--r-- | subprojects/store-query/src/main/java/tools/refinery/store/query/EmptyResultSet.java | 29 | ||||
-rw-r--r-- | subprojects/store-query/src/main/java/tools/refinery/store/query/ResultSet.java | 16 |
2 files changed, 5 insertions, 40 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 a01a5a2f..0c2e07d6 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 | |||
@@ -1,49 +1,22 @@ | |||
1 | package tools.refinery.store.query; | 1 | package tools.refinery.store.query; |
2 | 2 | ||
3 | import tools.refinery.store.tuple.Tuple; | ||
4 | import tools.refinery.store.tuple.TupleLike; | 3 | import tools.refinery.store.tuple.TupleLike; |
5 | 4 | ||
6 | import java.util.Optional; | ||
7 | import java.util.stream.Stream; | 5 | import java.util.stream.Stream; |
8 | 6 | ||
9 | public class EmptyResultSet implements ResultSet { | 7 | public class EmptyResultSet implements ResultSet { |
10 | @Override | 8 | @Override |
11 | public boolean hasResult() { | 9 | public boolean hasResult(TupleLike parameters) { |
12 | return false; | 10 | return false; |
13 | } | 11 | } |
14 | 12 | ||
15 | @Override | 13 | @Override |
16 | public boolean hasResult(Tuple parameters) { | ||
17 | return false; | ||
18 | } | ||
19 | |||
20 | @Override | ||
21 | public Optional<TupleLike> oneResult() { | ||
22 | return Optional.empty(); | ||
23 | } | ||
24 | |||
25 | @Override | ||
26 | public Optional<TupleLike> oneResult(Tuple parameters) { | ||
27 | return Optional.empty(); | ||
28 | } | ||
29 | |||
30 | @Override | ||
31 | public Stream<TupleLike> allResults() { | 14 | public Stream<TupleLike> allResults() { |
32 | return Stream.of(); | 15 | return Stream.of(); |
33 | } | 16 | } |
34 | 17 | ||
35 | @Override | 18 | @Override |
36 | public Stream<TupleLike> allResults(Tuple parameters) { | ||
37 | return Stream.of(); | ||
38 | } | ||
39 | |||
40 | @Override | ||
41 | public int countResults() { | 19 | public int countResults() { |
42 | return 0; | 20 | return 0; |
43 | } | 21 | } |
44 | |||
45 | @Override | ||
46 | public int countResults(Tuple parameters) { | ||
47 | return 0; | ||
48 | } | ||
49 | } | 22 | } |
diff --git a/subprojects/store-query/src/main/java/tools/refinery/store/query/ResultSet.java b/subprojects/store-query/src/main/java/tools/refinery/store/query/ResultSet.java index 3542e252..407cf075 100644 --- a/subprojects/store-query/src/main/java/tools/refinery/store/query/ResultSet.java +++ b/subprojects/store-query/src/main/java/tools/refinery/store/query/ResultSet.java | |||
@@ -1,25 +1,17 @@ | |||
1 | package tools.refinery.store.query; | 1 | package tools.refinery.store.query; |
2 | 2 | ||
3 | import tools.refinery.store.tuple.Tuple; | ||
4 | import tools.refinery.store.tuple.TupleLike; | 3 | import tools.refinery.store.tuple.TupleLike; |
5 | 4 | ||
6 | import java.util.Optional; | ||
7 | import java.util.stream.Stream; | 5 | import java.util.stream.Stream; |
8 | 6 | ||
9 | public interface ResultSet { | 7 | public interface ResultSet { |
10 | boolean hasResult(); | 8 | default boolean hasResult() { |
9 | return countResults() > 0; | ||
10 | } | ||
11 | 11 | ||
12 | boolean hasResult(Tuple parameters); | 12 | boolean hasResult(TupleLike parameters); |
13 | |||
14 | Optional<TupleLike> oneResult(); | ||
15 | |||
16 | Optional<TupleLike> oneResult(Tuple parameters); | ||
17 | 13 | ||
18 | Stream<TupleLike> allResults(); | 14 | Stream<TupleLike> allResults(); |
19 | 15 | ||
20 | Stream<TupleLike> allResults(Tuple parameters); | ||
21 | |||
22 | int countResults(); | 16 | int countResults(); |
23 | |||
24 | int countResults(Tuple parameters); | ||
25 | } | 17 | } |