final DimensionType dimensionType = dimension.getDimensionType();
final boolean isRange = dimension.isRange();
TreeSet<Object> tree = null;
switch (dimensionType) {
case TIME:
tree = new TreeSet(new DateRangeComparator());
// isRange ? new TreeSet(new DateRangeComparator()) : new TreeSet<Date>();
break;
case ELEVATION:
tree = new TreeSet(new NumberRangeComparator());
// isRange ? new TreeSet(new NumberRangeComparator()) : new TreeSet<Number>();
break;
case CUSTOM:
String dataType = dimension.getDatatype();
if (NCUtilities.isATime(dataType)) {
tree =
//new TreeSet(new DateRangeComparator());
isRange ? new TreeSet(new DateRangeComparator()) : new TreeSet<Date>();
} else {
tree = //new TreeSet<Object>();
isRange ? new TreeSet(new NumberRangeComparator()) : new TreeSet<Object>();
}
}