numericInterval.setMaxValue(minValue);
numericInterval.setMinValueIncluded(true);
numericInterval.setMaxValueIncluded(false);
// New composite interval.
CompositeInterval compositeMinInterval = new CompositeInterval();
Locale[] locales = LocaleManager.lookup().getPlatformAvailableLocales();
for (int i=0; i<locales.length; i++) {
Locale l = locales[i];
compositeMinInterval.setDescription("< " + ((NumericInterval) listOfIntervals.get(0)).getDescription(l), l);
}
Set listOfMinIntervals = new HashSet();
listOfMinIntervals.add(numericInterval);
compositeMinInterval.setIntervals(listOfMinIntervals);
compositeMinInterval.setDomain(this);
intervals.add(compositeMinInterval);
}
// Add the list of intervals.
intervals.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 (int i=0; i<locales.length; i++) {
Locale l = locales[i];
compositeMaxInterval.setDescription("> " + ((NumericInterval) listOfIntervals.get(listOfIntervals.size()-1)).getDescription(l), l);
}
Set listOfMaxIntervals = new HashSet();
listOfMaxIntervals.add(numericInterval);
compositeMaxInterval.setIntervals(listOfMaxIntervals);
compositeMaxInterval.setDomain(this);
intervals.add(compositeMaxInterval);
}
Interval[] results = new Interval[intervals.size()];
for (int i = 0; i < results.length; i++) results[i] = (Interval) intervals.get(i);