Class AbstractFieldComparator
- java.lang.Object
-
- org.apache.lucene.search.FieldComparator
-
- org.apache.jackrabbit.core.query.lucene.FieldComparatorBase
-
- org.apache.jackrabbit.core.query.lucene.sort.AbstractFieldComparator
-
- Direct Known Subclasses:
DynamicOperandFieldComparator
public abstract class AbstractFieldComparator extends FieldComparatorBase
Abstract base class forFieldComparator
s which keep their values (Comparable
s) in an array.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.search.FieldComparator
FieldComparator.ByteComparator, FieldComparator.DocComparator, FieldComparator.DoubleComparator, FieldComparator.FloatComparator, FieldComparator.IntComparator, FieldComparator.LongComparator, FieldComparator.NumericComparator<T extends Number>, FieldComparator.RelevanceComparator, FieldComparator.ShortComparator, FieldComparator.StringComparatorLocale, FieldComparator.StringOrdValComparator, FieldComparator.StringValComparator
-
-
Field Summary
Fields Modifier and Type Field Description protected List<IndexReader>
readers
The index readers.protected int[]
starts
The document number starts for thereaders
.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractFieldComparator(int numHits)
Create a new instance with the given number of values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getUUIDForIndex(int doc)
Comparable<?>
getValue(int slot)
Return a value from the values arrayprotected int
readerIndex(int n)
Returns the reader index for documentn
.void
setNextReader(IndexReader reader, int docBase)
void
setValue(int slot, Comparable<?> value)
Add the given value to the values array-
Methods inherited from class org.apache.jackrabbit.core.query.lucene.FieldComparatorBase
compare, compare, compareBottom, copy, setBottom, sortValue, value
-
Methods inherited from class org.apache.lucene.search.FieldComparator
binarySearch, binarySearch, compareValues, setScorer
-
-
-
-
Field Detail
-
readers
protected final List<IndexReader> readers
The index readers.
-
starts
protected int[] starts
The document number starts for thereaders
.
-
-
Method Detail
-
readerIndex
protected final int readerIndex(int n)
Returns the reader index for documentn
.- Parameters:
n
- document number.- Returns:
- the reader index.
-
setValue
public void setValue(int slot, Comparable<?> value)
Add the given value to the values array- Specified by:
setValue
in classFieldComparatorBase
- Parameters:
slot
- index into valuesvalue
- value for adding
-
getValue
public Comparable<?> getValue(int slot)
Return a value from the values array- Specified by:
getValue
in classFieldComparatorBase
- Parameters:
slot
- index to retrieve- Returns:
- the retrieved value
-
setNextReader
public void setNextReader(IndexReader reader, int docBase) throws IOException
- Specified by:
setNextReader
in classFieldComparator
- Throws:
IOException
-
getUUIDForIndex
protected String getUUIDForIndex(int doc) throws IOException
- Throws:
IOException
-
-