Search in sources :

Example 1 with BasicTextDataset

use of org.locationtech.geowave.core.index.text.BasicTextDataset 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

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 FilterRange (org.locationtech.geowave.core.store.query.filter.expression.FilterRange)1