Style Intelligence v12.0

inetsoft.graph.data
Class SortedDataSet

java.lang.Object
  extended by inetsoft.graph.data.AbstractDataSet
      extended by inetsoft.graph.data.AbstractDataSetFilter
          extended by inetsoft.graph.data.SortedDataSet
All Implemented Interfaces:
AttributeDataSet, DataSet, DataSetFilter, Serializable, Cloneable

public class SortedDataSet
extends AbstractDataSetFilter

SortedDataSet sorts the base data set by comparing the values of a measure or dimension.

See Also:
Serialized Form

Constructor Summary
SortedDataSet(DataSet base)
          Create an instance of SortedDataSet.
SortedDataSet(DataSet base, String[] cols)
          Create an instance of SortedDataSet.
 
Method Summary
 void addSortColumn(String col, boolean sortrow)
          Add a column to be sorted.
 Object clone()
          Clone the data set.
 int getBaseRow(int r)
          Get the base row index on its base data set of the specified row.
 Comparator getComparator0(String col)
          Get the comparator for sorting.
 int getEndRow()
          Get the ending row to sort.
protected  int getRowCount0()
          Return the number of rows in the chart lens.
 String[] getSortColumns()
          Get the sorting columns.
 int getStartRow()
          Get the starting row to sort.
 void prepareCalc(String dim, int[] rows)
          This method must be called before the calculated columns can be used.
 void setComparator(String col, Comparator comp)
          Set the comparator for sorting.
 void setEndRow(int end)
          Set the ending row to sort.
 void setStartRow(int start)
          Set the starting row to sort.
 
Methods inherited from class inetsoft.graph.data.AbstractDataSetFilter
convertToField, getBaseCol, getCalcColumns, getCalcRows, getColCount0, getData0, getDataSet, getDrillHyperlinks, getDrillHyperlinks, getFormat, getFormat, getHeader0, getHyperlink, getHyperlink, getRootCol, getRootDataSet, getRootRow, getType0, indexOfHeader0, isMeasure0, prepareGraph, removeCalcValues
 
Methods inherited from class inetsoft.graph.data.AbstractDataSet
addCalcColumn, addCalcRow, getCalcColumns, getColCount, getComparator, getData, getData, getHeader, getRowCount, getType, indexOfHeader, isMeasure, process, removeCalcColumns, removeCalcColValues, removeCalcRows, removeCalcRows, removeCalcRowValues
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface inetsoft.graph.data.DataSet
addCalcColumn, addCalcRow, getCalcColumns, getColCount, getComparator, getData, getData, getHeader, getRowCount, getType, indexOfHeader, isMeasure, removeCalcColumns, removeCalcColValues, removeCalcRows, removeCalcRows, removeCalcRowValues
 

Constructor Detail

SortedDataSet

public SortedDataSet(DataSet base)
Create an instance of SortedDataSet.

Parameters:
base - the specified base data set.

SortedDataSet

public SortedDataSet(DataSet base,
                     String[] cols)
Create an instance of SortedDataSet.

Parameters:
base - the specified base data set.
cols - the sorting column.
Method Detail

addSortColumn

public void addSortColumn(String col,
                          boolean sortrow)
Add a column to be sorted.

Parameters:
col - the sorting column.
sortrow - true to sort using the row comparison of DataSetComparator.

getSortColumns

public String[] getSortColumns()
Get the sorting columns.


prepareCalc

public void prepareCalc(String dim,
                        int[] rows)
This method must be called before the calculated columns can be used.

Specified by:
prepareCalc in interface DataSet
Overrides:
prepareCalc in class AbstractDataSet
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.

setComparator

public void setComparator(String col,
                          Comparator comp)
Set the comparator for sorting.


getComparator0

public Comparator getComparator0(String col)
Get the comparator for sorting.

Overrides:
getComparator0 in class AbstractDataSetFilter
Parameters:
col - the specified column.
Returns:
the comparer to sort data at the specified column.

getBaseRow

public int getBaseRow(int r)
Get the base row index on its base data set of the specified row.

Specified by:
getBaseRow in interface DataSetFilter
Overrides:
getBaseRow in class AbstractDataSetFilter
Parameters:
r - the specified row index.
Returns:
the base row index on base data set, -1 if no base row.

getRowCount0

protected int getRowCount0()
Return the number of rows in the chart lens.

Overrides:
getRowCount0 in class AbstractDataSetFilter

setStartRow

public void setStartRow(int start)
Set the starting row to sort. The default is 0.


getStartRow

public int getStartRow()
Get the starting row to sort.


setEndRow

public void setEndRow(int end)
Set the ending row to sort.

Parameters:
end - the ending row (non-inclusive). Use -1 to use all rows.

getEndRow

public int getEndRow()
Get the ending row to sort.


clone

public Object clone()
Clone the data set.

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

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