LUCENE-2649, add svn:eol-style, some missing headers and expose the Parser and SortType

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1001534 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan McKinley 2010-09-26 22:00:58 +00:00
parent cddf318f8c
commit b849d518a0
14 changed files with 1865 additions and 1753 deletions

View File

@ -26,7 +26,9 @@ import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.FieldCache; import org.apache.lucene.search.FieldCache;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.FieldCache.ByteParser; import org.apache.lucene.search.FieldCache.ByteParser;
import org.apache.lucene.search.FieldCache.Parser;
import org.apache.lucene.search.cache.CachedArray.ByteValues; import org.apache.lucene.search.cache.CachedArray.ByteValues;
import org.apache.lucene.util.Bits; import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
@ -53,6 +55,16 @@ public class ByteValuesCreator extends CachedArrayCreator<ByteValues>
return Byte.class; return Byte.class;
} }
@Override
public Parser getParser() {
return parser;
}
@Override
public int getSortTypeID() {
return SortField.BYTE;
}
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------

View File

@ -40,7 +40,7 @@ public abstract class CachedArrayCreator<T extends CachedArray> extends EntryCre
public static final int CACHE_VALUES_AND_BITS = OPTION_CACHE_VALUES ^ OPTION_CACHE_BITS; public static final int CACHE_VALUES_AND_BITS = OPTION_CACHE_VALUES ^ OPTION_CACHE_BITS;
public static final int CACHE_VALUES_AND_BITS_VALIDATE = OPTION_CACHE_VALUES ^ OPTION_CACHE_BITS ^ OPTION_VALIDATE; public static final int CACHE_VALUES_AND_BITS_VALIDATE = OPTION_CACHE_VALUES ^ OPTION_CACHE_BITS ^ OPTION_VALIDATE;
public String field; public final String field;
public CachedArrayCreator( String field ) public CachedArrayCreator( String field )
{ {
@ -72,6 +72,8 @@ public abstract class CachedArrayCreator<T extends CachedArray> extends EntryCre
/** Return the type that the array will hold */ /** Return the type that the array will hold */
public abstract Class getArrayType(); public abstract Class getArrayType();
public abstract Parser getParser();
public abstract int getSortTypeID();
protected void assertSameParserAndResetCounts(T value, Parser parser) protected void assertSameParserAndResetCounts(T value, Parser parser)
{ {

View File

@ -26,7 +26,9 @@ import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.FieldCache; import org.apache.lucene.search.FieldCache;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.FieldCache.DoubleParser; import org.apache.lucene.search.FieldCache.DoubleParser;
import org.apache.lucene.search.FieldCache.Parser;
import org.apache.lucene.search.cache.CachedArray.DoubleValues; import org.apache.lucene.search.cache.CachedArray.DoubleValues;
import org.apache.lucene.util.Bits; import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
@ -53,6 +55,15 @@ public class DoubleValuesCreator extends CachedArrayCreator<DoubleValues>
return Double.class; return Double.class;
} }
@Override
public Parser getParser() {
return parser;
}
@Override
public int getSortTypeID() {
return SortField.DOUBLE;
}
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------

View File

@ -23,7 +23,7 @@ public abstract class EntryCreatorWithOptions<T> extends EntryCreator<T>
{ {
public static final int OPTION_VALIDATE = 1; public static final int OPTION_VALIDATE = 1;
public int flags; private int flags;
public EntryCreatorWithOptions( int flag ) { public EntryCreatorWithOptions( int flag ) {
this.flags = flag; this.flags = flag;
@ -38,4 +38,8 @@ public abstract class EntryCreatorWithOptions<T> extends EntryCreator<T>
{ {
return (flags & key) == key; return (flags & key) == key;
} }
public void setFlag(int flag) {
this.flags |= flag;
}
} }

View File

@ -1,5 +1,22 @@
package org.apache.lucene.search.cache; package org.apache.lucene.search.cache;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** /**
* A Simple marker class -- Perhaps it could/should just be an Object * A Simple marker class -- Perhaps it could/should just be an Object

View File

@ -26,7 +26,9 @@ import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.FieldCache; import org.apache.lucene.search.FieldCache;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.FieldCache.FloatParser; import org.apache.lucene.search.FieldCache.FloatParser;
import org.apache.lucene.search.FieldCache.Parser;
import org.apache.lucene.search.cache.CachedArray.FloatValues; import org.apache.lucene.search.cache.CachedArray.FloatValues;
import org.apache.lucene.util.Bits; import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
@ -53,6 +55,16 @@ public class FloatValuesCreator extends CachedArrayCreator<FloatValues>
return Float.class; return Float.class;
} }
@Override
public Parser getParser() {
return parser;
}
@Override
public int getSortTypeID() {
return SortField.FLOAT;
}
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------

View File

@ -26,7 +26,9 @@ import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.FieldCache; import org.apache.lucene.search.FieldCache;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.FieldCache.IntParser; import org.apache.lucene.search.FieldCache.IntParser;
import org.apache.lucene.search.FieldCache.Parser;
import org.apache.lucene.search.cache.CachedArray.IntValues; import org.apache.lucene.search.cache.CachedArray.IntValues;
import org.apache.lucene.util.Bits; import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
@ -53,6 +55,16 @@ public class IntValuesCreator extends CachedArrayCreator<IntValues>
return Integer.class; return Integer.class;
} }
@Override
public Parser getParser() {
return parser;
}
@Override
public int getSortTypeID() {
return SortField.INT;
}
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------

View File

@ -26,7 +26,9 @@ import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.FieldCache; import org.apache.lucene.search.FieldCache;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.FieldCache.LongParser; import org.apache.lucene.search.FieldCache.LongParser;
import org.apache.lucene.search.FieldCache.Parser;
import org.apache.lucene.search.cache.CachedArray.LongValues; import org.apache.lucene.search.cache.CachedArray.LongValues;
import org.apache.lucene.util.Bits; import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
@ -53,6 +55,16 @@ public class LongValuesCreator extends CachedArrayCreator<LongValues>
return Long.class; return Long.class;
} }
@Override
public Parser getParser() {
return parser;
}
@Override
public int getSortTypeID() {
return SortField.LONG;
}
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------

View File

@ -26,6 +26,8 @@ import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.FieldCache; import org.apache.lucene.search.FieldCache;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.FieldCache.Parser;
import org.apache.lucene.search.FieldCache.ShortParser; import org.apache.lucene.search.FieldCache.ShortParser;
import org.apache.lucene.search.cache.CachedArray.ShortValues; import org.apache.lucene.search.cache.CachedArray.ShortValues;
import org.apache.lucene.util.Bits; import org.apache.lucene.util.Bits;
@ -53,6 +55,16 @@ public class ShortValuesCreator extends CachedArrayCreator<ShortValues>
return Short.class; return Short.class;
} }
@Override
public Parser getParser() {
return parser;
}
@Override
public int getSortTypeID() {
return SortField.SHORT;
}
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------

View File

@ -1,5 +1,23 @@
package org.apache.lucene.search.cache; package org.apache.lucene.search.cache;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class SimpleEntryKey extends EntryKey public class SimpleEntryKey extends EntryKey
{ {
public final Class clazz; public final Class clazz;