Object oContent = ds.getValues( ); if ( ds instanceof NumberDataSet ) { iDataType = IConstants.NUMERICAL; if ( oContent instanceof Collection ) { iContentType = IConstants.COLLECTION; co = (Collection) oContent; } else if ( oContent instanceof double[] ) { iContentType = IConstants.PRIMITIVE_ARRAY; da = (double[]) oContent; } else if ( oContent instanceof Double[] ) { iContentType = IConstants.NON_PRIMITIVE_ARRAY; dda = (Double[]) oContent; } else if ( oContent instanceof Number ) { iContentType = IConstants.PRIMITIVE_ARRAY; da = new double[]{ ( (Number) oContent ).doubleValue( ) }; } } else if ( ds instanceof DateTimeDataSet ) { iDataType = IConstants.DATE_TIME; if ( oContent instanceof Collection ) { iContentType = IConstants.COLLECTION; co = (Collection) oContent; } else if ( oContent instanceof long[] ) { iContentType = IConstants.PRIMITIVE_ARRAY; la = (long[]) oContent; cReused = Calendar.getInstance( ); } else if ( oContent instanceof Calendar[] ) { iContentType = IConstants.NON_PRIMITIVE_ARRAY; ca = (Calendar[]) oContent; } updateDateTimeValues( ); } else if ( ds instanceof TextDataSet ) { iDataType = IConstants.TEXT; if ( oContent instanceof Collection ) { iContentType = IConstants.COLLECTION; co = (Collection) oContent; } else if ( oContent instanceof String[] ) { iContentType = IConstants.NON_PRIMITIVE_ARRAY; sa = (String[]) oContent; } } else if ( ds instanceof StockDataSet ) { iDataType = IConstants.OTHER; if ( oContent instanceof Collection ) { iContentType = IConstants.COLLECTION; co = (Collection) oContent; } else if ( oContent instanceof Object[] ) { iContentType = IConstants.NON_PRIMITIVE_ARRAY; oa = (Object[]) oContent; } iDataType = IConstants.UNDEFINED; }  if ( iContentType == IConstants.UNDEFINED ) { throw new IllegalArgumentException( MessageFormat.format( ResourceBundle.getBundle( Messages.ENGINE, Locale.getDefault( ) ) .getString( "exception.process.content.dataset" ), new Object[]{ oContent, ds } )  ); }  if ( co != null ) { it = co.iterator( ); }  iRowCount = getRowCountInternal( );
this.dda = dda; iDataType = IConstants.NUMERICAL; iContentType = IConstants.NON_PRIMITIVE_ARRAY; iRowCount = dda.length;
	public DataSetIterator( DataSet ds ) throws IllegalArgumentException,			ChartException	{		Object oContent = ds.getValues( );		if ( ds instanceof NumberDataSet )		{			iDataType = IConstants.NUMERICAL;			if ( oContent instanceof Collection )			{				iContentType = IConstants.COLLECTION;				co = (Collection) oContent;			}			else if ( oContent instanceof double[] )			{				iContentType = IConstants.PRIMITIVE_ARRAY;				da = (double[]) oContent;			}			else if ( oContent instanceof Double[] )			{				iContentType = IConstants.NON_PRIMITIVE_ARRAY;				dda = (Double[]) oContent;			}			else if ( oContent instanceof Number )			{				iContentType = IConstants.PRIMITIVE_ARRAY;				da = new double[]{					( (Number) oContent ).doubleValue( )				};			}		}		else if ( ds instanceof DateTimeDataSet )		{			iDataType = IConstants.DATE_TIME;			if ( oContent instanceof Collection )			{				iContentType = IConstants.COLLECTION;				co = (Collection) oContent;			}			else if ( oContent instanceof long[] )			{				iContentType = IConstants.PRIMITIVE_ARRAY;				la = (long[]) oContent;				cReused = Calendar.getInstance( );			}			else if ( oContent instanceof Calendar[] )			{				iContentType = IConstants.NON_PRIMITIVE_ARRAY;				ca = (Calendar[]) oContent;			}			updateDateTimeValues( );		}		else if ( ds instanceof TextDataSet )		{			iDataType = IConstants.TEXT;			if ( oContent instanceof Collection )			{				iContentType = IConstants.COLLECTION;				co = (Collection) oContent;			}			else if ( oContent instanceof String[] )			{				iContentType = IConstants.NON_PRIMITIVE_ARRAY;				sa = (String[]) oContent;			}		}		else if ( ds instanceof StockDataSet )		{			iDataType = IConstants.OTHER;			if ( oContent instanceof Collection )			{				iContentType = IConstants.COLLECTION;				co = (Collection) oContent;			}			else if ( oContent instanceof Object[] )			{				iContentType = IConstants.NON_PRIMITIVE_ARRAY;				oa = (Object[]) oContent;			}			iDataType = IConstants.UNDEFINED;		}		if ( iContentType == IConstants.UNDEFINED )		{			throw new IllegalArgumentException( MessageFormat.format( ResourceBundle.getBundle( Messages.ENGINE,					Locale.getDefault( ) // LOCALE?					)					.getString( "exception.process.content.dataset" ), //$NON-NLS-1$					new Object[]{							oContent, ds					} )			);		}		if ( co != null )		{			it = co.iterator( );		}		iRowCount = getRowCountInternal( );	}