if ( isDate( columnType ) ) groupBy = new GroupByDateRange( groupDefn ); else throw new DataException( ResourceConstants.BAD_GROUP_INTERVAL_TYPE, new Object[]{ "date", columnType.getName( ) } );
groupBy = new GroupByNumberRange( groupDefn ); break;
	public static GroupBy newInstance( GroupSpec groupDefn, int columnIndex, String columnName,			Class columnType ) throws DataException	{		assert groupDefn != null;		GroupBy groupBy = null;		switch ( groupDefn.getInterval( ) )		{			case GroupSpec.NO_INTERVAL :				groupBy = new GroupByDistinctValue( );				break;			case GroupSpec.NUMERIC_INTERVAL :				if ( isNumber( columnType ) )					groupBy = new GroupByNumberRange( groupDefn );				else					throw new DataException( ResourceConstants.BAD_GROUP_INTERVAL_TYPE,							new Object[]{									"numeric", columnType.getName( )							} );				break;			case GroupSpec.STRING_PREFIX_INTERVAL :				if ( isString( columnType ) )					groupBy = new GroupByStringRange( groupDefn );				else					throw new DataException( ResourceConstants.BAD_GROUP_INTERVAL_TYPE,							new Object[]{									"string prefix", columnType.getName( )							} );				break;			default :				if ( isDate( columnType ) )					groupBy = new GroupByDateRange( groupDefn );				else					throw new DataException( ResourceConstants.BAD_GROUP_INTERVAL_TYPE,							new Object[]{									"date", columnType.getName( )							} );		}		groupBy.groupSpec = groupDefn;		groupBy.columnIndex = columnIndex;		groupBy.columnName = columnName;		return groupBy;	}