numericInterval.setMaxValue(minValue);
numericInterval.setMinValueIncluded(true);
numericInterval.setMaxValueIncluded(false);
// New composite interval.
CompositeInterval compositeMinInterval = new CompositeInterval();
Locale[] locales = LocaleManager.lookup().getPlatformAvailableLocales();
for (Locale l : locales) {
compositeMinInterval.setDescription("< " + ((NumericInterval) listOfIntervals.get(0)).getDescription(l), l);
}
Set<Interval> listOfMinIntervals = new HashSet<Interval>();
listOfMinIntervals.add(numericInterval);
compositeMinInterval.setIntervals(listOfMinIntervals);
compositeMinInterval.setDomain(this);
results.add(compositeMinInterval);
}
// Add the list of intervals.
results.addAll(listOfIntervals);
// If there are values after the maxValue, create the final composite interval.
if (maxValue != null && absoluteMaxValue.longValue() > maxValue.longValue()) {
// New date interval.
NumericInterval numericInterval = new NumericInterval();
numericInterval.setMinValue(maxValue);
numericInterval.setMaxValue(absoluteMaxValue);
numericInterval.setMinValueIncluded(false);
numericInterval.setMaxValueIncluded(true);
// New composite interval.
CompositeInterval compositeMaxInterval = new CompositeInterval();
Locale[] locales = LocaleManager.lookup().getPlatformAvailableLocales();
for (Locale l : locales) {
compositeMaxInterval.setDescription("> " + ((NumericInterval) listOfIntervals.get(listOfIntervals.size()-1)).getDescription(l), l);
}
Set<Interval> listOfMaxIntervals = new HashSet<Interval>();
listOfMaxIntervals.add(numericInterval);
compositeMaxInterval.setIntervals(listOfMaxIntervals);
compositeMaxInterval.setDomain(this);
results.add(compositeMaxInterval);
}
return results;
}