public RangePruner(FeatureRange range, PredicateOptions options, int arity) {
from = range.getFromInclusive() != null ? range.getFromInclusive() : options.getAdjustedLowerBound();
to = range.getToInclusive() != null ? range.getToInclusive() : options.getAdjustedUpperBound();
if (from > options.getUpperBound()) {
long upperRangeStart = Long.MAX_VALUE - (Long.MAX_VALUE % arity) - arity;
if (options.getUpperBound() < upperRangeStart) {
from = upperRangeStart;
to = upperRangeStart + arity - 1;
} else {
to = from;
}
} else if (to < options.getLowerBound()) {
long lowerRangeEnd = Long.MIN_VALUE + (arity - (Long.MIN_VALUE % arity));
if (options.getLowerBound() > lowerRangeEnd) {
from = lowerRangeEnd - arity + 1;
to = lowerRangeEnd;
} else {
from = to;
}
} else {
if (from < options.getLowerBound()) {
from = options.getAdjustedLowerBound();
}
if (to > options.getUpperBound()) {
to = options.getAdjustedUpperBound();
}
}
}