| Nils Diewald | f399a67 | 2013-11-18 17:55:22 +0000 | [diff] [blame] | 1 | package de.ids_mannheim.korap.query.wrap; |
| 2 | |
| 3 | import org.apache.lucene.search.spans.SpanQuery; |
| 4 | |
| 5 | import de.ids_mannheim.korap.query.SpanMatchModifyQuery; |
| 6 | import de.ids_mannheim.korap.query.wrap.SpanQueryWrapperInterface; |
| 7 | |
| 8 | import java.util.*; |
| 9 | |
| 10 | |
| 11 | public class SpanMatchModifyQueryWrapper implements SpanQueryWrapperInterface { |
| 12 | private SpanQueryWrapperInterface subquery; |
| 13 | private byte number; |
| 14 | |
| 15 | public SpanMatchModifyQueryWrapper (SpanQueryWrapperInterface subquery, byte number) { |
| 16 | this.subquery = subquery; |
| 17 | this.number = number; |
| 18 | }; |
| 19 | |
| 20 | public SpanMatchModifyQueryWrapper (SpanQueryWrapperInterface subquery, short number) { |
| 21 | this.subquery = subquery; |
| 22 | this.number = (byte) number; |
| 23 | }; |
| 24 | |
| 25 | public SpanMatchModifyQueryWrapper (SpanQueryWrapperInterface subquery, int number) { |
| 26 | this.subquery = subquery; |
| 27 | this.number = (byte) number; |
| 28 | }; |
| 29 | |
| 30 | public SpanMatchModifyQueryWrapper (SpanQueryWrapperInterface subquery) { |
| 31 | this.subquery = subquery; |
| 32 | this.number = (byte) 0; |
| 33 | }; |
| 34 | |
| 35 | public SpanQuery toQuery () { |
| 36 | return new SpanMatchModifyQuery(this.subquery.toQuery(), this.number); |
| 37 | }; |
| 38 | }; |