Package org.apache.lucene.search
Class LongValuesSource.ConstantLongValuesSource
- java.lang.Object
-
- org.apache.lucene.search.LongValuesSource
-
- org.apache.lucene.search.LongValuesSource.ConstantLongValuesSource
-
- All Implemented Interfaces:
SegmentCacheable
- Enclosing class:
- LongValuesSource
public static class LongValuesSource.ConstantLongValuesSource extends LongValuesSource
A ConstantLongValuesSource that always returns a constant value- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.search.LongValuesSource
LongValuesSource.ConstantLongValuesSource
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)longgetValue()Get the constant value.LongValuesgetValues(LeafReaderContext ctx, DoubleValues scores)Returns aLongValuesinstance for the passed-in LeafReaderContext and scoresinthashCode()booleanisCacheable(LeafReaderContext ctx)booleanneedsScores()Return true if document scores are needed to calculate valuesLongValuesSourcerewrite(IndexSearcher searcher)Return a LongValuesSource specialised for the given IndexSearcherStringtoString()-
Methods inherited from class org.apache.lucene.search.LongValuesSource
constant, fromIntField, fromLongField, getSortField, toDoubleValuesSource
-
-
-
-
Method Detail
-
getValues
public LongValues getValues(LeafReaderContext ctx, DoubleValues scores) throws IOException
Description copied from class:LongValuesSourceReturns aLongValuesinstance for the passed-in LeafReaderContext and scoresIf scores are not needed to calculate the values (ie
returns false, callers may safely passnullfor thescoresparameter.- Specified by:
getValuesin classLongValuesSource- Throws:
IOException
-
isCacheable
public boolean isCacheable(LeafReaderContext ctx)
- Returns:
trueif the object can be cached against a given leaf
-
needsScores
public boolean needsScores()
Description copied from class:LongValuesSourceReturn true if document scores are needed to calculate values- Specified by:
needsScoresin classLongValuesSource
-
hashCode
public int hashCode()
- Specified by:
hashCodein classLongValuesSource
-
equals
public boolean equals(Object o)
- Specified by:
equalsin classLongValuesSource
-
toString
public String toString()
- Specified by:
toStringin classLongValuesSource
-
rewrite
public LongValuesSource rewrite(IndexSearcher searcher) throws IOException
Description copied from class:LongValuesSourceReturn a LongValuesSource specialised for the given IndexSearcherImplementations should assume that this will only be called once. IndexSearcher-independent implementations can just return
this- Specified by:
rewritein classLongValuesSource- Throws:
IOException
-
getValue
public long getValue()
Get the constant value.
-
-