public class DateField extends AnalyticsField implements DateValue.CastingDateValue
TrieDateField
or DatePointField
with DocValues enabled.DateValue.AbstractDateValue, DateValue.CastingDateValue
DateValueStream.AbstractDateValueStream, DateValueStream.CastingDateValueStream
LongValue.AbstractLongValue, LongValue.CastingLongValue
LongValueStream.AbstractLongValueStream, LongValueStream.CastingLongValueStream
AnalyticsValue.AbstractAnalyticsValue
AnalyticsValueStream.ExpressionType
StringValue.AbstractStringValue, StringValue.CastingStringValue
StringValueStream.AbstractStringValueStream, StringValueStream.CastingStringValueStream
fieldName, initialArrayLength
Modifier and Type | Method and Description |
---|---|
void |
collect(int doc)
Collect the value(s) of the wrapped field for the given document, and store the value.
|
void |
doSetNextReader(LeafReaderContext context)
Set the segment reader context
|
boolean |
exists()
Check whether the current value exists.
|
Date |
getDate()
Get the date representation of the current value.
|
long |
getLong()
Get the long representation of the current value.
|
Object |
getObject()
Get the object representation of the current value.
|
ExpressionComparator<Date> |
getObjectComparator(String expression)
Create an entry comparator used to sort the facet-value buckets of a facet.
|
String |
getString()
Get the String representation of the current value.
|
void |
streamDates(Consumer<Date> cons)
Stream the date representations of all current values, if any exist.
|
void |
streamLongs(LongConsumer cons)
Stream the long representations of all current values, if any exist.
|
void |
streamObjects(Consumer<Object> cons)
Stream the object representations of all current values, if any exist.
|
void |
streamStrings(Consumer<String> cons)
Stream the String representations of all current values, if any exist.
|
getExpressionStr, getExpressionType, getName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createExpressionString, determineMappingPhase, getExpressionStr, getExpressionType, getName
public DateField(String fieldName)
public void doSetNextReader(LeafReaderContext context) throws IOException
AnalyticsField
doSetNextReader
in class AnalyticsField
context
- segment contextIOException
- if an error occurs while loading the leaf readerpublic void collect(int doc) throws IOException
AnalyticsField
collect
in class AnalyticsField
doc
- ID of the document to collectIOException
- if an error occurs while reading the document.public long getLong()
LongValue
NOTE: The value returned is not valid unless calling AnalyticsValue.exists()
afterwards returns TRUE
.
public Date getDate()
DateValue
NOTE: The value returned is not valid unless calling AnalyticsValue.exists()
afterwards returns TRUE
.
public String getString()
StringValue
NOTE: The value returned is not valid unless calling AnalyticsValue.exists()
afterwards returns TRUE
.
getString
in interface StringValue
public Object getObject()
AnalyticsValue
getObject
in interface AnalyticsValue
public boolean exists()
AnalyticsValue
get<Type>()
method is called.exists
in interface AnalyticsValue
public void streamLongs(LongConsumer cons)
LongValueStream
streamLongs
in interface LongValueStream
cons
- The consumer to accept the valuespublic void streamDates(Consumer<Date> cons)
DateValueStream
streamDates
in interface DateValueStream
cons
- The consumer to accept the valuespublic void streamStrings(Consumer<String> cons)
StringValueStream
streamStrings
in interface StringValueStream
cons
- The consumer to accept the valuespublic void streamObjects(Consumer<Object> cons)
AnalyticsValueStream
streamObjects
in interface AnalyticsValueStream
cons
- The consumer to accept the valuespublic ExpressionComparator<Date> getObjectComparator(String expression)
ComparableValue
getObjectComparator
in interface ComparableValue
expression
- the name of the expression in the results arrayCopyright © 2000-2017 Apache Software Foundation. All Rights Reserved.