Class DataSheet

java.lang.Object
quadbase.ChartAPI.DataSheet

public class DataSheet extends Object
This class provides a functionality to merge multiple data sources together. User can create a DataSheet class from a different data sources, for example, data file, database, spreadSheetModel, and IResultSet. And user can use a QbChart constructor for DataSheet array to create a chart object.
  • Constructor Details

    • DataSheet

      public DataSheet(Applet applet, IDatabaseInfo dbInfo, boolean doTranspose)
      Create 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(Applet applet, IDatabaseInfo dbInfo, boolean doTranspose, int[] transposeColIdx)
      Create 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(Applet applet, String dataFile, boolean doTranspose)
      Create 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(Applet applet, String dataFile, boolean doTranspose, int[] transposeColIdx)
      Create 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(Applet applet, String dataFile, boolean doTranspose, int[] transposeColIdx, int dataFileType)
      Create 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(Applet applet, IResultSet data, boolean doTranspose)
      Create 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(Applet applet, IResultSet data, boolean doTranspose, int[] transposeColIdx)
      Create 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(Applet applet, EJBInfo ejbInfo)
      Create 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(Applet applet, EJBInfo ejbInfo, boolean doTranspose)
      Create 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(Applet applet, EJBInfo ejbInfo, boolean doTranspose, int[] transposeColIdx)
      Create 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(Applet applet, XMLFileQueryInfo xmlFileQueryInfo, boolean doTranspose, int[] transposeColIdx)
      Create a new dataSheet from XML File
      Parameters:
      applet - the applet containing the chart. Use "(Applet)null" if used within an application
      doTranspose - a flag denoting whether the input data has to be transposed into a result
      transposeColIdx - transposing selected column index
      xmlFiledQueryInfo - xml info to plot chart.
    • DataSheet

      public DataSheet(Applet applet, ISpreadSheetModel spreadSheet)
      Create 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 Details

    • transpose

      public void transpose() throws Exception
      set data transpose
      limitation: all data columns (except the first column) must have same data type
      Throws:
      Exception
    • transpose

      public void transpose(int[] transposeCol) throws Exception
      set data transpose
      Parameters:
      transposeCol - transposing selected column index
      Throws:
      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 Object[] getRow(int no)
      returns specified row data
      Parameters:
      no - row number
      Returns:
      object array which containing row data
    • addRow

      public void addRow(Object[] record)
      add a new row data
      Parameters:
      record - new row data object
    • deleteRow

      public void deleteRow(int no)
      delete a specified row
      Parameters:
      no - row number of deleted row
    • updateRow

      public void updateRow(Object[] record, int no)
      update the specified row
      Parameters:
      record - the new row data
      no - the row number to update
    • print

      public void print(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