1 package org.apache.lucene.search.function;
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 org.apache.lucene.index.IndexReader;
21 import org.apache.lucene.search.FieldCache;
23 import java.io.IOException;
26 * Holds all implementations of classes in the o.a.l.s.function package as a
27 * back-compatibility test. It does not run any tests per-se, however if
28 * someone adds a method to an interface or abstract method to an abstract
29 * class, one of the implementations here will fail to compile and so we know
30 * back-compat policy was violated.
32 final class JustCompileSearchFunction {
34 private static final String UNSUPPORTED_MSG = "unsupported: used for back-compat testing only !";
36 static final class JustCompileDocValues extends DocValues {
38 public float floatVal(int doc) {
39 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
43 public String toString(int doc) {
44 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
49 static final class JustCompileFieldCacheSource extends FieldCacheSource {
51 public JustCompileFieldCacheSource(String field) {
56 public boolean cachedFieldSourceEquals(FieldCacheSource other) {
57 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
61 public int cachedFieldSourceHashCode() {
62 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
66 public DocValues getCachedFieldValues(FieldCache cache, String field,
67 IndexReader reader) throws IOException {
68 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
73 static final class JustCompileValueSource extends ValueSource {
75 public String description() {
76 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
80 public boolean equals(Object o) {
81 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
85 public DocValues getValues(IndexReader reader) throws IOException {
86 throw new UnsupportedOperationException(UNSUPPORTED_MSG);
90 public int hashCode() {
91 throw new UnsupportedOperationException(UNSUPPORTED_MSG);