public abstract class RangeEndpointCalculator<T extends Comparable<T>> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RangeEndpointCalculator.DateRangeEndpointCalculator |
static class |
RangeEndpointCalculator.DoubleRangeEndpointCalculator |
static class |
RangeEndpointCalculator.FacetRange |
static class |
RangeEndpointCalculator.FloatRangeEndpointCalculator |
static class |
RangeEndpointCalculator.IntegerRangeEndpointCalculator |
static class |
RangeEndpointCalculator.LongRangeEndpointCalculator |
Modifier and Type | Field and Description |
---|---|
protected SchemaField |
field |
protected RangeFacetRequest |
request |
Constructor and Description |
---|
RangeEndpointCalculator(RangeFacetRequest request) |
Modifier and Type | Method and Description |
---|---|
T |
addGap(T value,
String gap)
Adds the String gap param to a low Range endpoint value to determine
the corrisponding high Range endpoint value, throwing
a useful exception if not possible.
|
static RangeEndpointCalculator<? extends Comparable<?>> |
create(RangeFacetRequest request) |
String |
formatValue(T val)
Formats a Range endpoint for use as a range label name in the response.
|
Object |
getGap(String gap)
Parses a String param into a value that represents the gap and
can be included in the response, throwing
a useful exception if not possible.
|
List<RangeEndpointCalculator.FacetRange> |
getRanges() |
T |
getValue(String rawval)
Parses a String param into an Range endpoint value throwing
a useful exception if not possible
|
protected abstract T |
parseAndAddGap(T value,
String gap)
Adds the String gap param to a low Range endpoint value to determine
the corrisponding high Range endpoint value.
|
protected Object |
parseGap(String rawval)
Parses a String param into a value that represents the gap and
can be included in the response.
|
protected abstract T |
parseVal(String rawval)
Parses a String param into an Range endpoint.
|
protected final SchemaField field
protected final RangeFacetRequest request
public RangeEndpointCalculator(RangeFacetRequest request)
public String formatValue(T val)
public final T getValue(String rawval)
protected abstract T parseVal(String rawval) throws ParseException
ParseException
public final Object getGap(String gap)
protected Object parseGap(String rawval) throws ParseException
ParseException
public final T addGap(T value, String gap)
protected abstract T parseAndAddGap(T value, String gap) throws ParseException
ParseException
public List<RangeEndpointCalculator.FacetRange> getRanges()
public static RangeEndpointCalculator<? extends Comparable<?>> create(RangeFacetRequest request)
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.