1 package org.apache.lucene.search.spans;
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with
6 * this work for additional information regarding copyright ownership.
7 * The ASF licenses this file to You under the Apache License, Version 2.0
8 * (the "License"); you may not use this file except in compliance with
9 * the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 import java.io.IOException;
21 import java.util.Collection;
23 import org.apache.lucene.index.IndexReader;
24 import org.apache.lucene.search.Weight;
25 import org.apache.lucene.search.Similarity;
28 * Holds all implementations of classes in the o.a.l.s.spans package as a
29 * back-compatibility test. It does not run any tests per-se, however if
30 * someone adds a method to an interface or abstract method to an abstract
31 * class, one of the implementations here will fail to compile and so we know
32 * back-compat policy was violated.
34 final class JustCompileSearchSpans {
36 private static final String UNSUPPORTED_MSG = "unsupported: used for back-compat testing only !";
38 static final class JustCompileSpans extends Spans {
42 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
47 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
51 public boolean next() throws IOException {
52 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
56 public boolean skipTo(int target) throws IOException {
57 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
62 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
66 public Collection<byte[]> getPayload() throws IOException {
67 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
71 public boolean isPayloadAvailable() {
72 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
77 static final class JustCompileSpanQuery extends SpanQuery {
80 public String getField() {
81 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
85 public Spans getSpans(IndexReader reader) throws IOException {
86 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
90 public String toString(String field) {
91 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
96 static final class JustCompilePayloadSpans extends Spans {
99 public Collection<byte[]> getPayload() throws IOException {
100 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
104 public boolean isPayloadAvailable() {
105 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
110 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
115 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
119 public boolean next() throws IOException {
120 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
124 public boolean skipTo(int target) throws IOException {
125 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
130 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
135 static final class JustCompileSpanScorer extends SpanScorer {
137 protected JustCompileSpanScorer(Spans spans, Weight weight,
138 Similarity similarity, byte[] norms) throws IOException {
139 super(spans, weight, similarity, norms);
143 protected boolean setFreqCurrentDoc() throws IOException {
144 throw new UnsupportedOperationException(UNSUPPORTED_MSG);