add --shared
[pylucene.git] / lucene-java-3.4.0 / lucene / backwards / src / test / org / apache / lucene / search / function / JustCompileSearchSpans.java
1 package org.apache.lucene.search.function;
2
3 /**
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
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  */
19
20 import org.apache.lucene.index.IndexReader;
21 import org.apache.lucene.search.FieldCache;
22
23 import java.io.IOException;
24
25 /**
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.
31  */
32 final class JustCompileSearchFunction {
33
34   private static final String UNSUPPORTED_MSG = "unsupported: used for back-compat testing only !";
35
36   static final class JustCompileDocValues extends DocValues {
37     @Override
38     public float floatVal(int doc) {
39       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
40     }
41
42     @Override
43     public String toString(int doc) {
44       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
45     }
46
47   }
48
49   static final class JustCompileFieldCacheSource extends FieldCacheSource {
50
51     public JustCompileFieldCacheSource(String field) {
52       super(field);
53     }
54
55     @Override
56     public boolean cachedFieldSourceEquals(FieldCacheSource other) {
57       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
58     }
59
60     @Override
61     public int cachedFieldSourceHashCode() {
62       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
63     }
64
65     @Override
66     public DocValues getCachedFieldValues(FieldCache cache, String field,
67                                           IndexReader reader) throws IOException {
68       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
69     }
70
71   }
72
73   static final class JustCompileValueSource extends ValueSource {
74     @Override
75     public String description() {
76       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
77     }
78
79     @Override
80     public boolean equals(Object o) {
81       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
82     }
83
84     @Override
85     public DocValues getValues(IndexReader reader) throws IOException {
86       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
87     }
88
89     @Override
90     public int hashCode() {
91       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
92     }
93
94   }
95
96 }