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