Class FieldComparatorBase
- java.lang.Object
-
- org.apache.lucene.search.FieldComparator
-
- org.apache.jackrabbit.core.query.lucene.FieldComparatorBase
-
- Direct Known Subclasses:
AbstractFieldComparator
public abstract class FieldComparatorBase extends FieldComparator
Abstract base class forFieldComparator
implementations which are based on values in the form ofComparables
.
-
-
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
-
-
Constructor Summary
Constructors Constructor Description FieldComparatorBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compare(int slot1, int slot2)
protected int
compare(Comparable<?> val1, Comparable<?> val2)
Compare two valuesint
compareBottom(int doc)
void
copy(int slot, int doc)
protected abstract Comparable<?>
getValue(int slot)
Retrieves the value of a given slotvoid
setBottom(int slot)
protected abstract void
setValue(int slot, Comparable<?> value)
Puts a value into a given slotprotected abstract Comparable<?>
sortValue(int doc)
Value for a documentComparable<?>
value(int slot)
-
Methods inherited from class org.apache.lucene.search.FieldComparator
binarySearch, binarySearch, compareValues, setNextReader, setScorer
-
-
-
-
Method Detail
-
sortValue
protected abstract Comparable<?> sortValue(int doc)
Value for a document- Parameters:
doc
- id of the document- Returns:
- the value for the given id
-
getValue
protected abstract Comparable<?> getValue(int slot)
Retrieves the value of a given slot- Parameters:
slot
- index of the value to retrieve- Returns:
- the value in the given slot
-
setValue
protected abstract void setValue(int slot, Comparable<?> value)
Puts a value into a given slot- Parameters:
slot
- index where to put the valuevalue
- the value to put into the given slot
-
compare
public int compare(int slot1, int slot2)
- Specified by:
compare
in classFieldComparator
-
compareBottom
public int compareBottom(int doc) throws IOException
- Specified by:
compareBottom
in classFieldComparator
- Throws:
IOException
-
setBottom
public void setBottom(int slot)
- Specified by:
setBottom
in classFieldComparator
-
compare
protected int compare(Comparable<?> val1, Comparable<?> val2)
Compare two values- Parameters:
val1
- first valueval2
- second value- Returns:
- A negative integer if
val1
comes beforeval2
, a positive integer ifval1
comes afterval2
and0
ifval1
andval2
are equal.
-
copy
public void copy(int slot, int doc) throws IOException
- Specified by:
copy
in classFieldComparator
- Throws:
IOException
-
value
public Comparable<?> value(int slot)
- Specified by:
value
in classFieldComparator
-
-