Package org.apache.lucene.document
Class XYPointSortField
- java.lang.Object
-
- org.apache.lucene.search.SortField
-
- org.apache.lucene.document.XYPointSortField
-
final class XYPointSortField extends SortField
Sorts by distance from an origin location.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.search.SortField
SortField.Provider, SortField.Type
-
-
Field Summary
Fields Modifier and Type Field Description (package private) floatx(package private) floaty-
Fields inherited from class org.apache.lucene.search.SortField
FIELD_DOC, FIELD_SCORE, missingValue, STRING_FIRST, STRING_LAST
-
-
Constructor Summary
Constructors Constructor Description XYPointSortField(java.lang.String field, float x, float y)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Returns true ifois equal to this.FieldComparator<?>getComparator(int numHits, int sortPos)Returns theFieldComparatorto use for sorting.java.lang.DoublegetMissingValue()Return the value to use for documents that don't have a value.inthashCode()Returns a hash code for thisSortFieldinstance.voidsetMissingValue(java.lang.Object missingValue)Set the value to use for documents that don't have a value.java.lang.StringtoString()-
Methods inherited from class org.apache.lucene.search.SortField
getBytesComparator, getCanUsePoints, getComparatorSource, getField, getIndexSorter, getReverse, getType, needsScores, readType, rewrite, setBytesComparator, setCanUsePoints
-
-
-
-
Method Detail
-
getComparator
public FieldComparator<?> getComparator(int numHits, int sortPos)
Description copied from class:SortFieldReturns theFieldComparatorto use for sorting.- Overrides:
getComparatorin classSortField- Parameters:
numHits- number of top hits the queue will storesortPos- position of this SortField withinSort. The comparator is primary if sortPos==0, secondary if sortPos==1, etc. Some comparators can optimize themselves when they are the primary sort.- Returns:
FieldComparatorto use when sorting
-
getMissingValue
public java.lang.Double getMissingValue()
Description copied from class:SortFieldReturn the value to use for documents that don't have a value. A value ofnullindicates that default should be used.- Overrides:
getMissingValuein classSortField
-
setMissingValue
public void setMissingValue(java.lang.Object missingValue)
Description copied from class:SortFieldSet the value to use for documents that don't have a value.- Overrides:
setMissingValuein classSortField
-
hashCode
public int hashCode()
Description copied from class:SortFieldReturns a hash code for thisSortFieldinstance. If aFieldComparatorSourcewas provided, it must properly implement hashCode (unless a singleton is always used).
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:SortFieldReturns true ifois equal to this. If aFieldComparatorSourcewas provided, it must properly implement equals (unless a singleton is always used).canUsePointsfield is not part ofequalsandhasCodeintentionally, as it is only useful during search-time and using it in these functions prevents index sorting optimizations that rely on the equality of the index-time and search-time SortField instances.
-
-