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 org.apache.lucene.search.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
org.apache.lucene.search.FieldComparator.ByteComparator, org.apache.lucene.search.FieldComparator.DocComparator, org.apache.lucene.search.FieldComparator.DoubleComparator, org.apache.lucene.search.FieldComparator.FloatComparator, org.apache.lucene.search.FieldComparator.IntComparator, org.apache.lucene.search.FieldComparator.LongComparator, org.apache.lucene.search.FieldComparator.NumericComparator<T extends Number>, org.apache.lucene.search.FieldComparator.RelevanceComparator, org.apache.lucene.search.FieldComparator.ShortComparator, org.apache.lucene.search.FieldComparator.StringComparatorLocale, org.apache.lucene.search.FieldComparator.StringOrdValComparator, org.apache.lucene.search.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)
-
-
-
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 classorg.apache.lucene.search.FieldComparator
-
compareBottom
public int compareBottom(int doc) throws IOException
- Specified by:
compareBottom
in classorg.apache.lucene.search.FieldComparator
- Throws:
IOException
-
setBottom
public void setBottom(int slot)
- Specified by:
setBottom
in classorg.apache.lucene.search.FieldComparator
-
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 classorg.apache.lucene.search.FieldComparator
- Throws:
IOException
-
value
public Comparable<?> value(int slot)
- Specified by:
value
in classorg.apache.lucene.search.FieldComparator
-
-