Style Intelligence v12.0

inetsoft.graph.data
Class AbstractDataSet

java.lang.Object
  extended by inetsoft.graph.data.AbstractDataSet
All Implemented Interfaces:
DataSet, Serializable, Cloneable
Direct Known Subclasses:
AbstractDataSetFilter, BoxDataSet, DefaultDataSet

public abstract class AbstractDataSet
extends Object
implements DataSet

This is the base class for data set. It implements the calculated columns.

See Also:
Serialized Form

Constructor Summary
AbstractDataSet()
           
 
Method Summary
 void addCalcColumn(CalcColumn col)
          Add a calculated columns.
 void addCalcRow(CalcRow row)
          Add a calculated rows.
 Object clone()
          Clone the data set.
 List getCalcColumns()
          Get the calculated columns.
protected  List getCalcColumns(boolean self)
          Get the calculated columns.
 List getCalcRows()
          Get the calculated rows.
 int getColCount()
          Return the number of columns in the data set.
protected abstract  int getColCount0()
          Return the number of columns in the data set without the calculated columns.
 Comparator getComparator(String col)
          Get the comparer to sort data at the specified column.
protected abstract  Comparator getComparator0(String col)
          Get the comparer to sort data at the specified column.
 Object getData(int col, int row)
          Return the data at the specified cell.
 Object getData(String col, int row)
          Return the data at the specified cell.
protected abstract  Object getData0(int col, int row)
          Return the data at the specified cell.
 String getHeader(int col)
          Return the column header at the specified column.
protected abstract  String getHeader0(int col)
          Return the column header at the specified column.
 int getRowCount()
          Return the number of rows in the data set.
protected abstract  int getRowCount0()
          Return the number of columns in the data set without the calculated rows.
 Class getType(String col)
          Get the data type of the column.
protected abstract  Class getType0(String col)
          Get the data type of the column.
 int indexOfHeader(String col)
          Get the index of the specified header.
protected abstract  int indexOfHeader0(String col)
          Get the index of the specified header.
 boolean isMeasure(String col)
          Check if the column is measure.
protected abstract  boolean isMeasure0(String col)
          Check if the column is measure.
 void prepareCalc(String dim, int[] rows)
          This method must be called before the calculated columns can be used.
 void prepareGraph(EGraph graph, Coordinate coord)
          Initialize any data for this graph.
 void process(EGraph graph, Coordinate coord)
          Generator dimension scale map for this data set.
 void removeCalcColumns()
          Remove all calculated columns.
 void removeCalcColValues()
          Clear the calculated column values.
 void removeCalcRows()
          Remove all calculated rows.
 void removeCalcRows(Class cls)
          Remove calc rows with the specified type.
 void removeCalcRowValues()
          Clear the calculated row values.
 void removeCalcValues()
          Clear the calculated colum and row values.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDataSet

public AbstractDataSet()
Method Detail

prepareCalc

public void prepareCalc(String dim,
                        int[] rows)
This method must be called before the calculated columns can be used. It is normally called by the graph rendering engine and doesn't need to be called explicitly by caller.

Specified by:
prepareCalc in interface DataSet
Parameters:
dim - the innermost dimension column in the graph.
rows - a list of row indexes to calculate values using CalcColumn. Calculate every row in sequence if it's null.

prepareGraph

public void prepareGraph(EGraph graph,
                         Coordinate coord)
Initialize any data for this graph.

Specified by:
prepareGraph in interface DataSet
Parameters:
graph - the (innermost) egraph that will plot this dataset.
coord - the (innermost) coordiante that will plot this dataset.

getRowCount

public final int getRowCount()
Return the number of rows in the data set.

Specified by:
getRowCount in interface DataSet

getColCount

public final int getColCount()
Return the number of columns in the data set.

Specified by:
getColCount in interface DataSet

getData

public Object getData(String col,
                      int row)
Return the data at the specified cell.

Specified by:
getData in interface DataSet
Parameters:
col - the specified column name.
row - the specified row index.
Returns:
the data at the specified cell.

getData

public Object getData(int col,
                      int row)
Return the data at the specified cell.

Specified by:
getData in interface DataSet
Parameters:
col - the specified column index.
row - the specified row index.
Returns:
the data at the specified cell.

indexOfHeader

public final int indexOfHeader(String col)
Get the index of the specified header.

Specified by:
indexOfHeader in interface DataSet
Parameters:
col - the specified column header.

getHeader

public final String getHeader(int col)
Return the column header at the specified column.

Specified by:
getHeader in interface DataSet
Parameters:
col - the specified column index.
Returns:
the column header at the specified column.

getType

public final Class getType(String col)
Get the data type of the column.

Specified by:
getType in interface DataSet

isMeasure

public final boolean isMeasure(String col)
Check if the column is measure.

Specified by:
isMeasure in interface DataSet
Parameters:
col - the specified column name.
Returns:
true if is measure, false otherwise.

getComparator

public final Comparator getComparator(String col)
Get the comparer to sort data at the specified column.

Specified by:
getComparator in interface DataSet
Parameters:
col - the specified column.

getData0

protected abstract Object getData0(int col,
                                   int row)
Return the data at the specified cell.

Parameters:
col - the specified column index.
row - the specified row index.

getColCount0

protected abstract int getColCount0()
Return the number of columns in the data set without the calculated columns.


getRowCount0

protected abstract int getRowCount0()
Return the number of columns in the data set without the calculated rows.


indexOfHeader0

protected abstract int indexOfHeader0(String col)
Get the index of the specified header.

Parameters:
col - the specified column header.

getHeader0

protected abstract String getHeader0(int col)
Return the column header at the specified column.

Parameters:
col - the specified column index.

getType0

protected abstract Class getType0(String col)
Get the data type of the column.


isMeasure0

protected abstract boolean isMeasure0(String col)
Check if the column is measure.

Parameters:
col - the specified column name.

getComparator0

protected abstract Comparator getComparator0(String col)
Get the comparer to sort data at the specified column.

Parameters:
col - the specified column.

addCalcColumn

public void addCalcColumn(CalcColumn col)
Add a calculated columns. If a column with the same name already exists, the existing column is replaced with the new column.

Specified by:
addCalcColumn in interface DataSet

getCalcColumns

public List getCalcColumns()
Get the calculated columns.

Specified by:
getCalcColumns in interface DataSet

getCalcColumns

protected List getCalcColumns(boolean self)
Get the calculated columns.

Parameters:
self - true to get the current data, otherwise recursively get all calc columns.

removeCalcColumns

public void removeCalcColumns()
Remove all calculated columns.

Specified by:
removeCalcColumns in interface DataSet

addCalcRow

public void addCalcRow(CalcRow row)
Add a calculated rows.

Specified by:
addCalcRow in interface DataSet

getCalcRows

public List getCalcRows()
Get the calculated rows.

Specified by:
getCalcRows in interface DataSet

removeCalcRows

public void removeCalcRows()
Remove all calculated rows.

Specified by:
removeCalcRows in interface DataSet

removeCalcRows

public void removeCalcRows(Class cls)
Remove calc rows with the specified type.

Specified by:
removeCalcRows in interface DataSet

removeCalcValues

public void removeCalcValues()
Clear the calculated colum and row values.

Specified by:
removeCalcValues in interface DataSet

removeCalcColValues

public void removeCalcColValues()
Description copied from interface: DataSet
Clear the calculated column values.

Specified by:
removeCalcColValues in interface DataSet

removeCalcRowValues

public void removeCalcRowValues()
Description copied from interface: DataSet
Clear the calculated row values.

Specified by:
removeCalcRowValues in interface DataSet

process

public void process(EGraph graph,
                    Coordinate coord)
Generator dimension scale map for this data set.


clone

public Object clone()
Clone the data set.

Specified by:
clone in interface DataSet
Overrides:
clone in class Object
Returns:
a copy of this object

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.