Search in sources :

Example 1 with FilterRange

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);
    }
}
Also used : NumericRange(org.locationtech.geowave.core.index.numeric.NumericRange) BasicNumericDataset(org.locationtech.geowave.core.index.numeric.BasicNumericDataset) NumericData(org.locationtech.geowave.core.index.numeric.NumericData) FilterRange(org.locationtech.geowave.core.store.query.filter.expression.FilterRange) NumericValue(org.locationtech.geowave.core.index.numeric.NumericValue)

Example 2 with FilterRange

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);
    }
}
Also used : BasicTextDataset(org.locationtech.geowave.core.index.text.BasicTextDataset) TextValue(org.locationtech.geowave.core.index.text.TextValue) TextData(org.locationtech.geowave.core.index.text.TextData) TextRange(org.locationtech.geowave.core.index.text.TextRange) FilterRange(org.locationtech.geowave.core.store.query.filter.expression.FilterRange)

Aggregations

FilterRange (org.locationtech.geowave.core.store.query.filter.expression.FilterRange)2 BasicNumericDataset (org.locationtech.geowave.core.index.numeric.BasicNumericDataset)1 NumericData (org.locationtech.geowave.core.index.numeric.NumericData)1 NumericRange (org.locationtech.geowave.core.index.numeric.NumericRange)1 NumericValue (org.locationtech.geowave.core.index.numeric.NumericValue)1 BasicTextDataset (org.locationtech.geowave.core.index.text.BasicTextDataset)1 TextData (org.locationtech.geowave.core.index.text.TextData)1 TextRange (org.locationtech.geowave.core.index.text.TextRange)1 TextValue (org.locationtech.geowave.core.index.text.TextValue)1