Module org.apache.lucene.core
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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.search.LongValuesSource
LongValuesSource.ConstantLongValuesSource
-
-
Field Summary
Fields Modifier and Type Field Description private long
value
-
Constructor Summary
Constructors Modifier Constructor Description private
ConstantLongValuesSource(long value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
long
getValue()
Get the constant value.LongValues
getValues(LeafReaderContext ctx, DoubleValues scores)
Returns aLongValues
instance for the passed-in LeafReaderContext and scoresint
hashCode()
boolean
isCacheable(LeafReaderContext ctx)
boolean
needsScores()
Return true if document scores are needed to calculate valuesLongValuesSource
rewrite(IndexSearcher searcher)
Return a LongValuesSource specialised for the given IndexSearcherjava.lang.String
toString()
-
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 java.io.IOException
Description copied from class:LongValuesSource
Returns aLongValues
instance for the passed-in LeafReaderContext and scoresIf scores are not needed to calculate the values (ie
returns false
, callers may safely passnull
for thescores
parameter.- Specified by:
getValues
in classLongValuesSource
- Throws:
java.io.IOException
-
isCacheable
public boolean isCacheable(LeafReaderContext ctx)
- Returns:
true
if the object can be cached against a given leaf
-
needsScores
public boolean needsScores()
Description copied from class:LongValuesSource
Return true if document scores are needed to calculate values- Specified by:
needsScores
in classLongValuesSource
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classLongValuesSource
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals
in classLongValuesSource
-
toString
public java.lang.String toString()
- Specified by:
toString
in classLongValuesSource
-
rewrite
public LongValuesSource rewrite(IndexSearcher searcher) throws java.io.IOException
Description copied from class:LongValuesSource
Return 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:
rewrite
in classLongValuesSource
- Throws:
java.io.IOException
-
getValue
public long getValue()
Get the constant value.
-
-