mirror of https://github.com/apache/lucene.git
replace 'static enum' with 'enum' (#36)
This commit is contained in:
parent
e6c4956cf6
commit
53fd63dbb2
|
@ -70,7 +70,7 @@ import org.apache.lucene.util.fst.FST;
|
|||
public final class JapaneseTokenizer extends Tokenizer {
|
||||
|
||||
/** Tokenization mode: this determines how the tokenizer handles compound and unknown words. */
|
||||
public static enum Mode {
|
||||
public enum Mode {
|
||||
/** Ordinary segmentation: no decomposition for compounds, */
|
||||
NORMAL,
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ public final class CharacterDefinition {
|
|||
public static final int CLASS_COUNT = CharacterClass.values().length;
|
||||
|
||||
// only used internally for lookup:
|
||||
private static enum CharacterClass {
|
||||
private enum CharacterClass {
|
||||
NGRAM,
|
||||
DEFAULT,
|
||||
SPACE,
|
||||
|
|
|
@ -105,7 +105,7 @@ import org.apache.lucene.util.packed.DirectMonotonicWriter;
|
|||
public class Lucene50StoredFieldsFormat extends StoredFieldsFormat {
|
||||
|
||||
/** Configuration option for stored fields. */
|
||||
public static enum Mode {
|
||||
public enum Mode {
|
||||
/** Trade compression ratio for retrieval speed. */
|
||||
BEST_SPEED,
|
||||
/** Trade retrieval speed for compression ratio. */
|
||||
|
|
|
@ -140,7 +140,7 @@ import org.apache.lucene.util.packed.DirectWriter;
|
|||
public final class Lucene80DocValuesFormat extends DocValuesFormat {
|
||||
|
||||
/** Configuration option for doc values. */
|
||||
public static enum Mode {
|
||||
public enum Mode {
|
||||
/** Trade compression ratio for retrieval speed. */
|
||||
BEST_SPEED,
|
||||
/** Trade retrieval speed for compression ratio. */
|
||||
|
|
|
@ -55,7 +55,7 @@ import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat;
|
|||
public class Lucene87Codec extends Codec {
|
||||
|
||||
/** Configuration option for the codec. */
|
||||
public static enum Mode {
|
||||
public enum Mode {
|
||||
/** Trade compression ratio for retrieval speed. */
|
||||
BEST_SPEED(Lucene87StoredFieldsFormat.Mode.BEST_SPEED, Lucene80DocValuesFormat.Mode.BEST_SPEED),
|
||||
/** Trade retrieval speed for compression ratio. */
|
||||
|
|
|
@ -103,7 +103,7 @@ import org.apache.lucene.util.packed.DirectMonotonicWriter;
|
|||
public class Lucene87StoredFieldsFormat extends StoredFieldsFormat {
|
||||
|
||||
/** Configuration option for stored fields. */
|
||||
public static enum Mode {
|
||||
public enum Mode {
|
||||
/** Trade compression ratio for retrieval speed. */
|
||||
BEST_SPEED,
|
||||
/** Trade retrieval speed for compression ratio. */
|
||||
|
|
|
@ -782,7 +782,7 @@
|
|||
*
|
||||
* <pre class="prettyprint">
|
||||
* public interface PartOfSpeechAttribute extends Attribute {
|
||||
* public static enum PartOfSpeech {
|
||||
* public enum PartOfSpeech {
|
||||
* Noun, Verb, Adjective, Adverb, Pronoun, Preposition, Conjunction, Article, Unknown
|
||||
* }
|
||||
*
|
||||
|
|
|
@ -46,7 +46,7 @@ import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat;
|
|||
public class Lucene90Codec extends Codec {
|
||||
|
||||
/** Configuration option for the codec. */
|
||||
public static enum Mode {
|
||||
public enum Mode {
|
||||
/** Trade compression ratio for retrieval speed. */
|
||||
BEST_SPEED(Lucene90StoredFieldsFormat.Mode.BEST_SPEED, Lucene90DocValuesFormat.Mode.BEST_SPEED),
|
||||
/** Trade retrieval speed for compression ratio. */
|
||||
|
|
|
@ -140,7 +140,7 @@ import org.apache.lucene.util.packed.DirectWriter;
|
|||
public final class Lucene90DocValuesFormat extends DocValuesFormat {
|
||||
|
||||
/** Configuration option for doc values. */
|
||||
public static enum Mode {
|
||||
public enum Mode {
|
||||
/** Trade compression ratio for retrieval speed. */
|
||||
BEST_SPEED,
|
||||
/** Trade retrieval speed for compression ratio. */
|
||||
|
|
|
@ -103,7 +103,7 @@ import org.apache.lucene.util.packed.DirectMonotonicWriter;
|
|||
public class Lucene90StoredFieldsFormat extends StoredFieldsFormat {
|
||||
|
||||
/** Configuration option for stored fields. */
|
||||
public static enum Mode {
|
||||
public enum Mode {
|
||||
/** Trade compression ratio for retrieval speed. */
|
||||
BEST_SPEED,
|
||||
/** Trade retrieval speed for compression ratio. */
|
||||
|
|
|
@ -169,7 +169,7 @@ public class DateTools {
|
|||
}
|
||||
|
||||
/** Specifies the time granularity. */
|
||||
public static enum Resolution {
|
||||
public enum Resolution {
|
||||
|
||||
/** Limit a date's resolution to year granularity. */
|
||||
YEAR(4),
|
||||
|
|
|
@ -579,7 +579,7 @@ public class Field implements IndexableField {
|
|||
}
|
||||
|
||||
/** Specifies whether and how a field should be stored. */
|
||||
public static enum Store {
|
||||
public enum Store {
|
||||
|
||||
/**
|
||||
* Store the original field value in the index. This is useful for short texts like a document's
|
||||
|
|
|
@ -47,7 +47,7 @@ public abstract class FilteredTermsEnum extends TermsEnum {
|
|||
*
|
||||
* @see #accept(BytesRef)
|
||||
*/
|
||||
protected static enum AcceptStatus {
|
||||
protected enum AcceptStatus {
|
||||
/** Accept the term and position the enum at the next term. */
|
||||
YES,
|
||||
/**
|
||||
|
|
|
@ -53,7 +53,7 @@ import org.apache.lucene.util.Version;
|
|||
public final class IndexWriterConfig extends LiveIndexWriterConfig {
|
||||
|
||||
/** Specifies the open mode for {@link IndexWriter}. */
|
||||
public static enum OpenMode {
|
||||
public enum OpenMode {
|
||||
/** Creates a new index or overwrites an existing one. */
|
||||
CREATE,
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public abstract class StoredFieldVisitor {
|
|||
public abstract Status needsField(FieldInfo fieldInfo) throws IOException;
|
||||
|
||||
/** Enumeration of possible return values for {@link #needsField}. */
|
||||
public static enum Status {
|
||||
public enum Status {
|
||||
/** YES: the field should be visited. */
|
||||
YES,
|
||||
/** NO: don't visit this field, but continue processing fields for this document. */
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.Objects;
|
|||
public final class BooleanClause {
|
||||
|
||||
/** Specifies how clauses are to occur in matching documents. */
|
||||
public static enum Occur {
|
||||
public enum Occur {
|
||||
|
||||
/** Use this operator for clauses that <i>must</i> appear in the matching documents. */
|
||||
MUST {
|
||||
|
|
|
@ -48,7 +48,7 @@ import org.apache.lucene.util.NumericUtils;
|
|||
public class SortField {
|
||||
|
||||
/** Specifies the type of the terms to be sorted, or special types such as CUSTOM */
|
||||
public static enum Type {
|
||||
public enum Type {
|
||||
|
||||
/**
|
||||
* Sort by document score (relevance). Sort values are Float and higher values are at the front.
|
||||
|
|
|
@ -209,7 +209,7 @@ public abstract class FilterSpans extends Spans {
|
|||
* Status returned from {@link FilterSpans#accept(Spans)} that indicates whether a candidate match
|
||||
* should be accepted, rejected, or rejected and move on to the next document.
|
||||
*/
|
||||
public static enum AcceptStatus {
|
||||
public enum AcceptStatus {
|
||||
/** Indicates the match should be accepted */
|
||||
YES,
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.util.List;
|
|||
public class VariableContext {
|
||||
|
||||
/** Represents what a piece of a variable does. */
|
||||
public static enum Type {
|
||||
public enum Type {
|
||||
/** A member of the previous context (ie "dot" access). */
|
||||
MEMBER,
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public class SpanPayloadCheckQuery extends SpanQuery {
|
|||
protected final MatchOperation operation;
|
||||
protected final PayloadType payloadType;
|
||||
/** The payload type. This specifies the decoding of the ByteRef for the payload. */
|
||||
public static enum PayloadType {
|
||||
public enum PayloadType {
|
||||
/** INT is for a 4 byte payload that is a packed integer */
|
||||
INT,
|
||||
/** FLOAT is a 4 byte payload decoded to a float(32bit). */
|
||||
|
@ -59,7 +59,7 @@ public class SpanPayloadCheckQuery extends SpanQuery {
|
|||
};
|
||||
|
||||
/** The payload type. This specifies the decoding of the ByteRef for the payload. */
|
||||
public static enum MatchOperation {
|
||||
public enum MatchOperation {
|
||||
/** Checks for binary equality of the byte array (default) */
|
||||
EQ,
|
||||
/** GT Matches if the payload value is greater than the reference */
|
||||
|
|
|
@ -183,7 +183,7 @@ public class StandardQueryConfigHandler extends QueryConfigHandler {
|
|||
}
|
||||
|
||||
/** Boolean Operator: AND or OR */
|
||||
public static enum Operator {
|
||||
public enum Operator {
|
||||
AND,
|
||||
OR;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class BlendedInfixSuggester extends AnalyzingInfixSuggester {
|
|||
private final BlenderType blenderType;
|
||||
|
||||
/** The different types of blender. */
|
||||
public static enum BlenderType {
|
||||
public enum BlenderType {
|
||||
/** Application dependent; override {@link #calculateCoefficient} to compute it. */
|
||||
CUSTOM,
|
||||
/** weight*(1 - 0.10*position) */
|
||||
|
|
|
@ -71,7 +71,7 @@ public class MockTokenizer extends Tokenizer {
|
|||
// TODO: "register" with LuceneTestCase to ensure all streams are closed() ?
|
||||
// currently, we can only check that the lifecycle is correct if someone is reusing,
|
||||
// but not for "one-offs".
|
||||
private static enum State {
|
||||
private enum State {
|
||||
SETREADER, // consumer set a reader input either via ctor or via reset(Reader)
|
||||
RESET, // consumer has called reset()
|
||||
INCREMENT, // consumer is consuming, has called incrementToken() == true
|
||||
|
|
|
@ -63,7 +63,7 @@ public class AlcoholicMergePolicy extends LogMergePolicy {
|
|||
return info.sizeInBytes();
|
||||
}
|
||||
|
||||
private static enum Drink {
|
||||
private enum Drink {
|
||||
Beer(15),
|
||||
Wine(17),
|
||||
Champagne(21),
|
||||
|
|
|
@ -349,7 +349,7 @@ public class AssertingLeafReader extends FilterLeafReader {
|
|||
}
|
||||
}
|
||||
|
||||
static enum DocsEnumState {
|
||||
enum DocsEnumState {
|
||||
START,
|
||||
ITERATING,
|
||||
FINISHED
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.Random;
|
|||
/** Wraps a Scorer with additional checks */
|
||||
public class AssertingScorer extends Scorer {
|
||||
|
||||
static enum IteratorState {
|
||||
enum IteratorState {
|
||||
APPROXIMATING,
|
||||
ITERATING,
|
||||
SHALLOW_ADVANCING,
|
||||
|
|
|
@ -26,7 +26,7 @@ class AssertingSpans extends Spans {
|
|||
int doc = -1;
|
||||
|
||||
/** tracks current state of this spans */
|
||||
static enum State {
|
||||
enum State {
|
||||
/** document iteration has not yet begun ({@link #docID()} = -1) */
|
||||
DOC_START,
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
|
|||
*
|
||||
* <p>WARNING: can make tests very slow.
|
||||
*/
|
||||
public static enum Throttling {
|
||||
public enum Throttling {
|
||||
/** always emulate a slow hard disk. could be very slow! */
|
||||
ALWAYS,
|
||||
/** sometimes (0.5% of the time) emulate a slow hard disk. */
|
||||
|
@ -756,7 +756,7 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
|
|||
return maybeThrottle(name, io);
|
||||
}
|
||||
|
||||
private static enum Handle {
|
||||
private enum Handle {
|
||||
Input,
|
||||
Output,
|
||||
Slice
|
||||
|
|
Loading…
Reference in New Issue