diff options
Diffstat (limited to 'src/uk/ac/ox/cs/pagoda/query')
| -rw-r--r-- | src/uk/ac/ox/cs/pagoda/query/QueryRecord.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/query/QueryRecord.java b/src/uk/ac/ox/cs/pagoda/query/QueryRecord.java index 8b73abb..fd20af1 100644 --- a/src/uk/ac/ox/cs/pagoda/query/QueryRecord.java +++ b/src/uk/ac/ox/cs/pagoda/query/QueryRecord.java | |||
| @@ -77,7 +77,7 @@ public class QueryRecord { | |||
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | public AnswerTuples getAnswers() { | 79 | public AnswerTuples getAnswers() { |
| 80 | if(processed()) | 80 | if(isProcessed()) |
| 81 | return getLowerBoundAnswers(); | 81 | return getLowerBoundAnswers(); |
| 82 | 82 | ||
| 83 | return getUpperBoundAnswers(); | 83 | return getUpperBoundAnswers(); |
| @@ -155,7 +155,8 @@ public class QueryRecord { | |||
| 155 | HashSet<AnswerTuple> difference = new HashSet<>(soundAnswerTuples); | 155 | HashSet<AnswerTuple> difference = new HashSet<>(soundAnswerTuples); |
| 156 | difference.removeAll(namedAnswerTuples); | 156 | difference.removeAll(namedAnswerTuples); |
| 157 | if(!difference.isEmpty()) | 157 | if(!difference.isEmpty()) |
| 158 | throw new IllegalArgumentException("The upper bound does not contain the lower bound!"); | 158 | throw new IllegalArgumentException("The upper bound does not contain the lower bound! Missing answers: " + difference |
| 159 | .size()); | ||
| 159 | } | 160 | } |
| 160 | /*** END: debugging ***/ | 161 | /*** END: debugging ***/ |
| 161 | 162 | ||
| @@ -192,7 +193,7 @@ public class QueryRecord { | |||
| 192 | processed = true; | 193 | processed = true; |
| 193 | } | 194 | } |
| 194 | 195 | ||
| 195 | public boolean processed() { | 196 | public boolean isProcessed() { |
| 196 | if(gapAnswerTuples != null && gapAnswerTuples.isEmpty()) processed = true; | 197 | if(gapAnswerTuples != null && gapAnswerTuples.isEmpty()) processed = true; |
| 197 | return processed; | 198 | return processed; |
| 198 | } | 199 | } |
| @@ -228,7 +229,7 @@ public class QueryRecord { | |||
| 228 | public void outputAnswers(BufferedWriter writer) throws IOException { | 229 | public void outputAnswers(BufferedWriter writer) throws IOException { |
| 229 | 230 | ||
| 230 | int answerCounter = soundAnswerTuples.size(); | 231 | int answerCounter = soundAnswerTuples.size(); |
| 231 | if(!processed()) answerCounter += gapAnswerTuples.size(); | 232 | if(!isProcessed()) answerCounter += gapAnswerTuples.size(); |
| 232 | 233 | ||
| 233 | Utility.logInfo("The number of answer tuples: " + answerCounter); | 234 | Utility.logInfo("The number of answer tuples: " + answerCounter); |
| 234 | 235 | ||
| @@ -254,7 +255,7 @@ public class QueryRecord { | |||
| 254 | writer.write(tuple.toString()); | 255 | writer.write(tuple.toString()); |
| 255 | writer.newLine(); | 256 | writer.newLine(); |
| 256 | } | 257 | } |
| 257 | if (!processed()) | 258 | if(!isProcessed()) |
| 258 | for (AnswerTuple tuple: gapAnswerTuples) { | 259 | for (AnswerTuple tuple: gapAnswerTuples) { |
| 259 | writer.write("*"); | 260 | writer.write("*"); |
| 260 | writer.write(tuple.toString()); | 261 | writer.write(tuple.toString()); |
| @@ -269,7 +270,7 @@ public class QueryRecord { | |||
| 269 | public void outputAnswerStatistics() { | 270 | public void outputAnswerStatistics() { |
| 270 | 271 | ||
| 271 | int answerCounter = soundAnswerTuples.size(); | 272 | int answerCounter = soundAnswerTuples.size(); |
| 272 | if (!processed()) answerCounter += gapAnswerTuples.size(); | 273 | if(!isProcessed()) answerCounter += gapAnswerTuples.size(); |
| 273 | 274 | ||
| 274 | Utility.logInfo("The number of answer tuples: " + answerCounter); | 275 | Utility.logInfo("The number of answer tuples: " + answerCounter); |
| 275 | // if (jsonAnswers != null) { | 276 | // if (jsonAnswers != null) { |
