| Eliza Margaretha | 1751dbf | 2014-02-03 09:47:19 +0000 | [diff] [blame] | 1 | package de.ids_mannheim.korap.query.spans; |
| 2 | |
| 3 | import java.io.IOException; |
| Eliza Margaretha | 9738c39 | 2014-02-03 17:04:53 +0000 | [diff] [blame] | 4 | import java.util.ArrayList; |
| 5 | import java.util.Collection; |
| 6 | import java.util.LinkedList; |
| 7 | import java.util.List; |
| Eliza Margaretha | 1751dbf | 2014-02-03 09:47:19 +0000 | [diff] [blame] | 8 | import java.util.Map; |
| 9 | |
| 10 | import org.apache.lucene.index.AtomicReaderContext; |
| 11 | import org.apache.lucene.index.Term; |
| 12 | import org.apache.lucene.index.TermContext; |
| Eliza Margaretha | 9738c39 | 2014-02-03 17:04:53 +0000 | [diff] [blame] | 13 | import org.apache.lucene.search.spans.Spans; |
| Eliza Margaretha | 1751dbf | 2014-02-03 09:47:19 +0000 | [diff] [blame] | 14 | import org.apache.lucene.util.Bits; |
| 15 | |
| 16 | import de.ids_mannheim.korap.query.SpanDistanceQuery; |
| 17 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 18 | /** |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 19 | * Enumeration of span matches, whose two child spans have a specific |
| 20 | * range of |
| 21 | * distance (within a minimum and a maximum distance) and can occur in |
| 22 | * any |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 23 | * order. |
| 24 | * |
| 25 | * @author margaretha |
| Eliza Margaretha | 9738c39 | 2014-02-03 17:04:53 +0000 | [diff] [blame] | 26 | * */ |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 27 | public abstract class UnorderedDistanceSpans extends DistanceSpans { |
| Eliza Margaretha | 1751dbf | 2014-02-03 09:47:19 +0000 | [diff] [blame] | 28 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 29 | protected int minDistance, maxDistance; |
| 30 | protected boolean hasMoreFirstSpans, hasMoreSecondSpans; |
| 31 | protected List<CandidateSpan> firstSpanList, secondSpanList; |
| 32 | protected List<CandidateSpan> matchList; |
| 33 | private long matchCost; |
| 34 | private int matchListSpanNum; |
| 35 | protected int currentDocNum; |
| Nils Diewald | 34eaa86 | 2014-06-03 10:56:27 +0000 | [diff] [blame] | 36 | |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 37 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 38 | /** |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 39 | * Constructs UnorderedDistanceSpans for the given |
| 40 | * {@link SpanDistanceQuery} . |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 41 | * |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 42 | * @param query |
| 43 | * a SpanDistanceQuery |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 44 | * @param context |
| 45 | * @param acceptDocs |
| 46 | * @param termContexts |
| 47 | * @throws IOException |
| 48 | */ |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 49 | public UnorderedDistanceSpans (SpanDistanceQuery query, |
| 50 | AtomicReaderContext context, |
| 51 | Bits acceptDocs, |
| 52 | Map<Term, TermContext> termContexts) |
| 53 | throws IOException { |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 54 | super(query, context, acceptDocs, termContexts); |
| 55 | minDistance = query.getMinDistance(); |
| 56 | maxDistance = query.getMaxDistance(); |
| Nils Diewald | 34eaa86 | 2014-06-03 10:56:27 +0000 | [diff] [blame] | 57 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 58 | firstSpanList = new ArrayList<CandidateSpan>(); |
| 59 | secondSpanList = new ArrayList<CandidateSpan>(); |
| 60 | matchList = new ArrayList<CandidateSpan>(); |
| Eliza Margaretha | 1751dbf | 2014-02-03 09:47:19 +0000 | [diff] [blame] | 61 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 62 | hasMoreFirstSpans = firstSpans.next(); |
| 63 | hasMoreSecondSpans = secondSpans.next(); |
| 64 | hasMoreSpans = hasMoreFirstSpans && hasMoreSecondSpans; |
| 65 | } |
| Eliza Margaretha | 9738c39 | 2014-02-03 17:04:53 +0000 | [diff] [blame] | 66 | |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 67 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 68 | @Override |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 69 | protected boolean advance () throws IOException { |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 70 | while (hasMoreSpans || !matchList.isEmpty()) { |
| 71 | if (!matchList.isEmpty()) { |
| 72 | setMatchProperties(); |
| 73 | return true; |
| 74 | } |
| 75 | if (prepareLists()) |
| 76 | setMatchList(); |
| 77 | } |
| 78 | return false; |
| 79 | } |
| Nils Diewald | 34eaa86 | 2014-06-03 10:56:27 +0000 | [diff] [blame] | 80 | |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 81 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 82 | /** |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 83 | * Updates the firstSpanList and secondSpanList by adding the next |
| 84 | * possible |
| 85 | * first and second spans. Both the spans must be in the same |
| 86 | * document. In |
| 87 | * UnorderedElementDistanceSpans, a span that is not in an element |
| 88 | * (distance |
| 89 | * unit), is not added to its candidate list. The element must |
| 90 | * also be in |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 91 | * the same document. |
| 92 | * |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 93 | * @return <code>true</code> if at least one of the candidate |
| 94 | * lists can be |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 95 | * filled, <code>false</code> otherwise. |
| 96 | * @throws IOException |
| 97 | */ |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 98 | protected abstract boolean prepareLists () throws IOException; |
| 99 | |
| Eliza Margaretha | 1751dbf | 2014-02-03 09:47:19 +0000 | [diff] [blame] | 100 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 101 | /** |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 102 | * Sets the list of matches for the span having the smallest |
| margaretha | 50110f3 | 2015-05-12 18:21:29 +0200 | [diff] [blame] | 103 | * position (i.e. between the first and the second spans), and its |
| 104 | * candidates (i.e. its counterparts). The candidates also must |
| 105 | * have smaller positions. Simply remove the span if it does not |
| 106 | * have any candidates. |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 107 | * |
| 108 | * @throws IOException |
| 109 | */ |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 110 | protected void setMatchList () throws IOException { |
| Eliza Margaretha | 1751dbf | 2014-02-03 09:47:19 +0000 | [diff] [blame] | 111 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 112 | hasMoreFirstSpans = setCandidateList(firstSpanList, firstSpans, |
| 113 | hasMoreFirstSpans, secondSpanList); |
| 114 | hasMoreSecondSpans = setCandidateList(secondSpanList, secondSpans, |
| 115 | hasMoreSecondSpans, firstSpanList); |
| 116 | // System.out.println("--------------------"); |
| 117 | // System.out.println("firstSpanList:"); |
| margaretha | 50110f3 | 2015-05-12 18:21:29 +0200 | [diff] [blame] | 118 | // for (CandidateSpan cs : firstSpanList) { |
| 119 | // System.out.println(cs.getStart() + " " + cs.getEnd()); |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 120 | // } |
| 121 | // |
| 122 | // System.out.println("secondSpanList:"); |
| margaretha | 50110f3 | 2015-05-12 18:21:29 +0200 | [diff] [blame] | 123 | // for (CandidateSpan cs : secondSpanList) { |
| 124 | // System.out.println(cs.getStart() + " " + cs.getEnd()); |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 125 | // } |
| 126 | |
| 127 | CandidateSpan currentFirstSpan, currentSecondSpan; |
| 128 | if (!firstSpanList.isEmpty() && !secondSpanList.isEmpty()) { |
| 129 | |
| 130 | currentFirstSpan = firstSpanList.get(0); |
| 131 | currentSecondSpan = secondSpanList.get(0); |
| 132 | |
| margaretha | 50110f3 | 2015-05-12 18:21:29 +0200 | [diff] [blame] | 133 | if (currentFirstSpan.getStart() < currentSecondSpan.getStart() |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 134 | || isLastCandidateSmaller(currentFirstSpan, |
| 135 | currentSecondSpan)) { |
| 136 | // log.trace("current target: " |
| 137 | // + firstSpanList.get(0).getStart() + " " |
| 138 | // + firstSpanList.get(0).getEnd()); |
| 139 | // System.out.println("candidates:"); |
| 140 | // for (CandidateSpan cs: secondSpanList) { |
| 141 | // System.out.println(cs.getStart() +" "+ cs.getEnd()); |
| 142 | // } |
| 143 | |
| 144 | matchList = findMatches(currentFirstSpan, secondSpanList); |
| 145 | setMatchFirstSpan(currentFirstSpan); |
| 146 | matchListSpanNum = 2; |
| 147 | updateList(firstSpanList); |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 148 | } |
| 149 | else { |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 150 | // log.trace("current target: " |
| 151 | // + secondSpanList.get(0).getStart() + " " |
| 152 | // + secondSpanList.get(0).getEnd()); |
| 153 | // System.out.println("candidates:"); |
| 154 | // for (CandidateSpan cs: firstSpanList) { |
| 155 | // System.out.println(cs.getStart() +" "+ cs.getEnd()); |
| 156 | // } |
| 157 | |
| 158 | matchList = findMatches(currentSecondSpan, firstSpanList); |
| 159 | setMatchSecondSpan(currentSecondSpan); |
| 160 | matchListSpanNum = 1; |
| 161 | updateList(secondSpanList); |
| 162 | } |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 163 | } |
| 164 | else if (firstSpanList.isEmpty()) { |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 165 | // log.trace("current target: " + secondSpanList.get(0).getStart() |
| 166 | // + " " + secondSpanList.get(0).getEnd()); |
| 167 | // log.trace("candidates: empty"); |
| 168 | updateList(secondSpanList); |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 169 | } |
| 170 | else { |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 171 | // log.trace("current target: " + firstSpanList.get(0).getStart() |
| 172 | // + " " + firstSpanList.get(0).getEnd()); |
| 173 | // log.trace("candidates: empty"); |
| 174 | updateList(firstSpanList); |
| 175 | } |
| 176 | } |
| 177 | |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 178 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 179 | /** |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 180 | * Tells if the last candidate from the secondSpanList has a |
| margaretha | 50110f3 | 2015-05-12 18:21:29 +0200 | [diff] [blame] | 181 | * smaller end position than the end position of the the last |
| 182 | * candidate from the firstSpanList. |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 183 | * |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 184 | * @param currentFirstSpan |
| 185 | * the current firstspan |
| 186 | * @param currentSecondSpan |
| 187 | * the current secondspan |
| 188 | * @return <code>true</code> if the end position of the last |
| margaretha | 50110f3 | 2015-05-12 18:21:29 +0200 | [diff] [blame] | 189 | * candidate from the secondSpanList is smaller than that |
| 190 | * from the firstSpanList, <code>false</code> otherwise. |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 191 | */ |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 192 | private boolean isLastCandidateSmaller (CandidateSpan currentFirstSpan, |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 193 | CandidateSpan currentSecondSpan) { |
| 194 | if (currentFirstSpan.getEnd() == currentSecondSpan.getEnd()) { |
| 195 | int secondEnd = secondSpanList.get(secondSpanList.size() - 1) |
| 196 | .getEnd(); |
| 197 | int firstEnd = firstSpanList.get(firstSpanList.size() - 1).getEnd(); |
| 198 | return (secondEnd < firstEnd ? true : false); |
| 199 | } |
| 200 | |
| 201 | return false; |
| 202 | } |
| 203 | |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 204 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 205 | /** |
| 206 | * Performs an update based on the given candidateList. In |
| 207 | * {@link UnorderedTokenDistanceSpans}, the first candidate in the |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 208 | * candidateList is simply removed. In |
| 209 | * {@link UnorderedElementDistanceSpans} , the elementList is also |
| 210 | * updated. |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 211 | * |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 212 | * @param candidateList |
| 213 | * a candidateList |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 214 | */ |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 215 | protected abstract void updateList (List<CandidateSpan> candidateList); |
| 216 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 217 | |
| 218 | /** |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 219 | * Sets the candidate list for the first element in the target |
| 220 | * list and |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 221 | * tells if the the specified spans has finished or not. |
| 222 | * |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 223 | * @param candidateList |
| 224 | * a list of candidate spans |
| 225 | * @param candidate |
| 226 | * a Spans |
| 227 | * @param hasMoreCandidates |
| 228 | * a boolean |
| 229 | * @param targetList |
| 230 | * a list of target spans |
| 231 | * @return <code>true</code> if the span enumeration still has a |
| 232 | * next |
| 233 | * element to be a candidate, <code>false</code> |
| 234 | * otherwise. |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 235 | * @throws IOException |
| 236 | */ |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 237 | protected abstract boolean setCandidateList ( |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 238 | List<CandidateSpan> candidateList, Spans candidate, |
| 239 | boolean hasMoreCandidates, List<CandidateSpan> targetList) |
| 240 | throws IOException; |
| 241 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 242 | |
| 243 | /** |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 244 | * Finds all matches between the target span and its candidates in |
| 245 | * the |
| 246 | * candidate list. |
| 247 | * |
| 248 | * @param target |
| 249 | * a target span |
| 250 | * @param candidateList |
| 251 | * a candidate list |
| 252 | * @return the matches in a list |
| 253 | */ |
| 254 | protected abstract List<CandidateSpan> findMatches (CandidateSpan target, |
| 255 | List<CandidateSpan> candidateList); |
| 256 | |
| 257 | |
| 258 | /** |
| 259 | * Computes match properties and creates a candidate span match to |
| 260 | * be added |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 261 | * to the match list. |
| 262 | * |
| 263 | * @return a candidate span match |
| 264 | * */ |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 265 | protected CandidateSpan createMatchCandidate (CandidateSpan target, |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 266 | CandidateSpan cs, boolean isDistanceZero) { |
| 267 | |
| 268 | int start = Math.min(target.getStart(), cs.getStart()); |
| 269 | int end = Math.max(target.getEnd(), cs.getEnd()); |
| 270 | int doc = target.getDoc(); |
| 271 | long cost = target.getCost() + cs.getCost(); |
| 272 | |
| 273 | Collection<byte[]> payloads = new LinkedList<byte[]>(); |
| 274 | if (collectPayloads) { |
| 275 | if (target.getPayloads() != null) { |
| 276 | payloads.addAll(target.getPayloads()); |
| 277 | } |
| 278 | if (cs.getPayloads() != null) { |
| 279 | payloads.addAll(cs.getPayloads()); |
| 280 | } |
| 281 | } |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 282 | CandidateSpan match = new CandidateSpan(start, end, doc, cost, payloads); |
| 283 | match.setChildSpan(cs); |
| 284 | return match; |
| 285 | } |
| 286 | |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 287 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 288 | /** |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 289 | * Assigns the first candidate span in the match list as the |
| 290 | * current span |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 291 | * match, and removes it from the matchList. |
| 292 | * */ |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 293 | private void setMatchProperties () { |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 294 | CandidateSpan cs = matchList.get(0); |
| 295 | matchDocNumber = cs.getDoc(); |
| 296 | matchStartPosition = cs.getStart(); |
| 297 | matchEndPosition = cs.getEnd(); |
| 298 | matchCost = cs.getCost(); |
| 299 | matchPayload.addAll(cs.getPayloads()); |
| 300 | matchList.remove(0); |
| 301 | |
| 302 | if (matchListSpanNum == 1) |
| 303 | setMatchFirstSpan(cs.getChildSpan()); |
| 304 | else |
| 305 | setMatchSecondSpan(cs.getChildSpan()); |
| 306 | |
| 307 | // log.trace("Match doc#={} start={} end={}", matchDocNumber, |
| 308 | // matchStartPosition, matchEndPosition); |
| 309 | // log.trace("firstspan " + getMatchFirstSpan().getStart() + " " |
| 310 | // + getMatchFirstSpan().getEnd()); |
| 311 | // log.trace("secondspan " + getMatchSecondSpan().getStart() + " " |
| 312 | // + getMatchSecondSpan().getEnd()); |
| 313 | } |
| 314 | |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 315 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 316 | @Override |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 317 | public boolean skipTo (int target) throws IOException { |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 318 | if (hasMoreSpans && (secondSpans.doc() < target)) { |
| 319 | if (!secondSpans.skipTo(target)) { |
| 320 | hasMoreSpans = false; |
| 321 | return false; |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | firstSpanList.clear(); |
| 326 | secondSpanList.clear(); |
| 327 | matchPayload.clear(); |
| 328 | isStartEnumeration = false; |
| 329 | return advance(); |
| 330 | } |
| 331 | |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 332 | |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 333 | @Override |
| Nils Diewald | bb33da2 | 2015-03-04 16:24:25 +0000 | [diff] [blame] | 334 | public long cost () { |
| Eliza Margaretha | 609a5be | 2014-12-18 16:52:20 +0000 | [diff] [blame] | 335 | return matchCost; |
| 336 | } |
| Eliza Margaretha | 1751dbf | 2014-02-03 09:47:19 +0000 | [diff] [blame] | 337 | |
| 338 | } |