EspressReport 6.6

quadbase.ChartAPI.swing
Class DataSheet

java.lang.Object
  extended by quadbase.ChartAPI.swing.DataSheet

public class DataSheet
extends java.lang.Object

This class provides a functionality to merge multiple data sources together. Users can create a DataSheet class from different data sources, such as data file, database, spreadSheetModel, and IResultSet. Users may use a QbChart constructor for DataSheet array to create a chart object.


Constructor Summary
DataSheet(java.applet.Applet applet, EJBInfo ejbInfo)
          Creates a new dataSheet from EJBInfo
DataSheet(java.applet.Applet applet, EJBInfo ejbInfo, boolean doTranspose)
          Creates a new dataSheet from EJBInfo
DataSheet(java.applet.Applet applet, EJBInfo ejbInfo, boolean doTranspose, int[] transposeColIdx)
          Creates a new dataSheet from EJBInfo
DataSheet(java.applet.Applet applet, IDatabaseInfo dbInfo, boolean doTranspose)
          Creates a new dataSheet from a database
DataSheet(java.applet.Applet applet, IDatabaseInfo dbInfo, boolean doTranspose, int[] transposeColIdx)
          Creates a new dataSheet from a database
DataSheet(java.applet.Applet applet, IResultSet data, boolean doTranspose)
          Creates a new dataSheet from IResultset
DataSheet(java.applet.Applet applet, IResultSet data, boolean doTranspose, int[] transposeColIdx)
          Creates a new dataSheet from IResultset
DataSheet(java.applet.Applet applet, ISpreadSheetModel spreadSheet)
          Creates a new dataSheet from spread sheet
DataSheet(java.applet.Applet applet, java.lang.String dataFile, boolean doTranspose)
          Creates a new dataSheet from a data file
DataSheet(java.applet.Applet applet, java.lang.String dataFile, boolean doTranspose, int[] transposeColIdx)
          Creates a new dataSheet from a data file
DataSheet(java.applet.Applet applet, java.lang.String dataFile, boolean doTranspose, int[] transposeColIdx, int dataFileType)
          Creates a new dataSheet from a data file
DataSheet(java.applet.Applet applet, XMLFileQueryInfo xmlFileQueryInfo, boolean doTranspose, int[] transposeColIdx)
          Creates a new dataSheet from XML File
 
Method Summary
 void addRow(java.lang.Object[] record)
          Adds a new row data object
 void deleteRow(int no)
          Deletes a specified row
 int getColumnCount()
          Returns number of columns
 java.lang.Object[] getRow(int no)
          Returns specified row data
 int getRowCount()
          Returns number of rows
 void print(java.io.PrintStream out, int separator, int format)
          Print Data File
 void transpose()
          Sets data transpose
limitation: all data columns (except the first column) must have same data type
 void transpose(int[] transposeCol)
          Sets data transpose
 void updateRow(java.lang.Object[] record, int no)
          Updates the specified row
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSheet

public DataSheet(java.applet.Applet applet,
                 IDatabaseInfo dbInfo,
                 boolean doTranspose)
Creates a new dataSheet from a database

Parameters:
applet - the applet containing the chart. Use "(Applet)null" if used within an application
dbInfo - database information, see interface IDatabaseInfo
doTranspose - a flag denoting whether the input data has to be transposed into a result set having three columns: RowLabel, ColumnLabel, and Value

DataSheet

public DataSheet(java.applet.Applet applet,
                 IDatabaseInfo dbInfo,
                 boolean doTranspose,
                 int[] transposeColIdx)
Creates a new dataSheet from a database

Parameters:
applet - the applet containing the chart. Use "(Applet)null" if used within an application
dbInfo - database information, see interface IDatabaseInfo
doTranspose - a flag denoting whether the input data has to be transposed into a result
transposeColIdx - transpose selected column index

DataSheet

public DataSheet(java.applet.Applet applet,
                 java.lang.String dataFile,
                 boolean doTranspose)
Creates a new dataSheet from a data file

Parameters:
applet - the applet containing the chart. Use "(Applet)null" if used within an application
dataFile - source data file, see database file format for details
doTranspose - a flag denoting whether the input data has to be transposed into a result set having three columns: RowLabel, ColumnLabel, and Value

DataSheet

public DataSheet(java.applet.Applet applet,
                 java.lang.String dataFile,
                 boolean doTranspose,
                 int[] transposeColIdx)
Creates a new dataSheet from a data file

Parameters:
applet - the applet containing the chart. Use "(Applet)null" if used within an application
dataFile - source data file, see database file format for details
doTranspose - a flag denoting whether the input data has to be transposed into a result set having three columns: RowLabel, ColumnLabel, and Value
transposeColIdx - transposing selected column index

DataSheet

public DataSheet(java.applet.Applet applet,
                 java.lang.String dataFile,
                 boolean doTranspose,
                 int[] transposeColIdx,
                 int dataFileType)
Creates a new dataSheet from a data file

Parameters:
applet - the applet containing the chart. Use "(Applet)null" if used within an application
dataFile - source data file, see database file format for details
doTranspose - a flag denoting whether the input data has to be transposed into a result set having three columns: RowLabel, ColumnLabel, and Value
transposeColIdx - transposing selected column index
dataFileType - Type of data file (QbChart.DATAFILE, QbChart.CLASSFILE or QbChart.XMLFILE)

DataSheet

public DataSheet(java.applet.Applet applet,
                 IResultSet data,
                 boolean doTranspose)
Creates a new dataSheet from IResultset

Parameters:
applet - the applet containing the chart. Use "(Applet)null" if used within an application
data - source data to plot chart, see IResultSet for details
doTranspose - a flag denoting whether the input data has to be transposed into a result set having three columns: RowLabel, ColumnLabel, and Value

DataSheet

public DataSheet(java.applet.Applet applet,
                 IResultSet data,
                 boolean doTranspose,
                 int[] transposeColIdx)
Creates a new dataSheet from IResultset

Parameters:
applet - the applet containing the chart. Use "(Applet)null" if used within an application
data - source data to plot chart, see IResultSet for details
doTranspose - a flag denoting whether the input data has to be transposed into a result
transposeColIdx - transposing selected column index

DataSheet

public DataSheet(java.applet.Applet applet,
                 EJBInfo ejbInfo)
Creates a new dataSheet from EJBInfo

Parameters:
applet - the applet containing the chart. Use "(Applet)null" if used within an application
ejbInfo - ejb info to plot chart.

DataSheet

public DataSheet(java.applet.Applet applet,
                 EJBInfo ejbInfo,
                 boolean doTranspose)
Creates a new dataSheet from EJBInfo

Parameters:
applet - the applet containing the chart. Use "(Applet)null" if used within an application
ejbInfo - ejb info to plot chart.
doTranspose - a flag denoting whether the input data has to be transposed into a result

DataSheet

public DataSheet(java.applet.Applet applet,
                 EJBInfo ejbInfo,
                 boolean doTranspose,
                 int[] transposeColIdx)
Creates a new dataSheet from EJBInfo

Parameters:
applet - the applet containing the chart. Use "(Applet)null" if used within an application
ejbInfo - ejb info to plot chart.
doTranspose - a flag denoting whether the input data has to be transposed into a result
transposeColIdx - transposing selected column index

DataSheet

public DataSheet(java.applet.Applet applet,
                 XMLFileQueryInfo xmlFileQueryInfo,
                 boolean doTranspose,
                 int[] transposeColIdx)
Creates a new dataSheet from XML File

Parameters:
applet - the applet containing the chart. Use "(Applet)null" if used within an application
xmlFiledQueryInfo - xml info to plot chart.
doTranspose - a flag denoting whether the input data has to be transposed into a result
transposeColIdx - transposing selected column index

DataSheet

public DataSheet(java.applet.Applet applet,
                 ISpreadSheetModel spreadSheet)
Creates a new dataSheet from spread sheet

Parameters:
applet - the applet containing the chart. Use "(Applet)null" if used within an application
spreadSheet - source data model for chart, see ISpreadSheetModel for details
Method Detail

transpose

public void transpose()
               throws java.lang.Exception
Sets data transpose
limitation: all data columns (except the first column) must have same data type

Throws:
java.lang.Exception

transpose

public void transpose(int[] transposeCol)
               throws java.lang.Exception
Sets data transpose

Parameters:
transposeCol - transposing selected column index
Throws:
java.lang.Exception

getRowCount

public int getRowCount()
Returns number of rows

Returns:
row count

getColumnCount

public int getColumnCount()
Returns number of columns

Returns:
column count

getRow

public java.lang.Object[] getRow(int no)
Returns specified row data

Parameters:
no - row number
Returns:
object array which containing row data

addRow

public void addRow(java.lang.Object[] record)
Adds a new row data object

Parameters:
record - new row data object

deleteRow

public void deleteRow(int no)
Deletes a specified row

Parameters:
no - row number of deleted row

updateRow

public void updateRow(java.lang.Object[] record,
                      int no)
Updates the specified row

Parameters:
record - the new row data
no - the row number to update

print

public void print(java.io.PrintStream out,
                  int separator,
                  int format)
Print Data File

Parameters:
out - The outputStream. The caller is responsible for closing it.
separator - Available separators are :
QbChart.COMMA
QbChart.SEMICOLON
QbChart.SPACE
format - Available format are :
QbChart.TXTFORMAT
QbChart.XMLFORMAT

EspressReport 6.6