use of org.locationtech.geowave.core.store.query.filter.expression.FilterRange in project geowave by locationtech.
the class NumericFieldConstraints method generateNumericData.
private static void generateNumericData(final List<MultiDimensionalIndexData<Double>> results, final int currentDimension, final List<DimensionConstraints<Double>> dimensions, final NumericData[] current) {
if (currentDimension == dimensions.size()) {
results.add(new BasicNumericDataset(current));
return;
}
final DimensionConstraints<Double> dimension = dimensions.get(currentDimension);
final List<FilterRange<Double>> ranges = dimension.getRanges();
for (int i = 0; i < ranges.size(); i++) {
final NumericData[] copy = Arrays.copyOf(current, current.length + 1);
final FilterRange<Double> range = ranges.get(i);
final Double start = toStartRangeValue(range.getStart());
final Double end = toEndRangeValue(range.getEnd());
if (start.equals(end) && range.isStartInclusive() && range.isEndInclusive()) {
copy[copy.length - 1] = new NumericValue(start);
} else {
copy[copy.length - 1] = new NumericRange(toStartRangeValue(range.getStart()), toEndRangeValue(range.getEnd()), range.isStartInclusive(), range.isEndInclusive());
}
generateNumericData(results, currentDimension + 1, dimensions, copy);
}
}
use of org.locationtech.geowave.core.store.query.filter.expression.FilterRange in project geowave by locationtech.
the class TextFieldConstraints method generateTextData.
private static void generateTextData(final List<MultiDimensionalIndexData<String>> results, final int currentDimension, final List<DimensionConstraints<String>> dimensions, final TextData[] current) {
if (currentDimension == dimensions.size()) {
results.add(new BasicTextDataset(current));
return;
}
final DimensionConstraints<String> dimension = dimensions.get(currentDimension);
final List<FilterRange<String>> ranges = dimension.getRanges();
for (int i = 0; i < ranges.size(); i++) {
final TextData[] copy = Arrays.copyOf(current, current.length + 1);
final TextFilterRange range = (TextFilterRange) ranges.get(i);
final String start = toStartRangeValue(range.getStart());
final String end = toEndRangeValue(range.getEnd());
if (start.equals(end) && range.isStartInclusive() && range.isEndInclusive()) {
copy[copy.length - 1] = new TextValue(start, range.isCaseSensitive(), range.isReversed());
} else {
copy[copy.length - 1] = new TextRange(toStartRangeValue(range.getStart()), toEndRangeValue(range.getEnd()), range.isStartInclusive(), range.isEndInclusive(), range.isCaseSensitive(), range.isReversed());
}
generateTextData(results, currentDimension + 1, dimensions, copy);
}
}
Aggregations