|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanetj.database.report.ReportBreak
Defines how and where reports should be generated for a RowCollection.
A report contains the results of an operation (such as a summation or average) on one or more columns in a group of Rows. These reports are contained in ReportBreakRows (a subclass of Row) and placed in the same RowCollection as the original Row objects.
ReportBreakRow objects are always located immediately after the group of Rows which were used to generate the contained report. This group of Rows may be a subset of the Rows returned by an SQL query, and it may include Rows from more than one RowCollection (in cases where the number of Rows returned by a query exceeds the number of Rows allowed in a RowCollection). The "break" where a ReportBreakRow is inserted is specified by the BreakColumn property - whenever two adjacent Rows contain different values in that column a report is generated and a ReportBreakRow is placed between those two Rows in the RowCollection.
ReportBreaks are intended to be used in conjunction with the ORDER BY sql clause. The ORDER BY clause will sort Rows by a specific column or columns, and then reports can be generated for each group of values that was ordered.
Nested Class Summary | |
static class |
ReportBreak.ReportBreakSpacingRow
|
Constructor Summary | |
ReportBreak()
ReportBreak constructor |
|
ReportBreak(ReportBreakCollection prbc,
java.lang.String pColumnFunctionToken,
java.util.List pFieldNames,
java.lang.String pBreakColumnName)
Deprecated. Use the default constructor instead. Relying on this constructor makes subclassing more difficult |
Method Summary | |
java.lang.Object |
clone()
Clones this ReportBreak |
ReportBreak |
cloneReportBreak()
Clones this ReportBreak |
boolean |
equals(java.lang.Object o)
Tests if this ReportBreak is equal to another ReportBreak. |
protected Row |
generateReport(java.util.List pFieldDescriptors)
Deprecated. Use the method which takes in a RowCollection as well |
protected Row |
generateReport(java.util.List pFieldDescriptors,
RowCollection rc)
Generates a report containing the values of all this ReportBreak's column functions. |
java.lang.String |
getBreakColumn()
Gets the name of the column which this ReportBreak will monitor for breaks. |
protected java.util.List |
getColumnFunctions()
Sets the List ColumnFunctions which are used to generate ReportBreakRows for this ReportBreak. |
java.lang.String |
getColumnFunctionToken()
Gets the column function token representing the function that will be used to generate this ReportBreak's reports |
java.util.List |
getFieldNames()
Gets the List of field names identifying the columns which will be used by this ReportBreak for generating ReportBreakRows. |
protected java.util.List |
getFieldNamesInternal()
Gets the List of field names identifying the columns which will be used by this ReportBreak for generating ReportBreakRows. |
int |
getIndex()
Gets the index of this ReportBreak. |
java.lang.Object |
getLastValue()
Gets the last value of the field which is being monitored for breaks |
OverallReportBreak |
getOverallReportBreak()
If an OverallReportBreak with the same field descriptors and column function was created when this ReportBreak was created, then that OverallReportBreak is returned. |
ReportBreakCollection |
getReportBreakCollection()
Gets the ReportBreakCollection which contains this ReportBreak |
java.util.List |
getRows()
Gets a List of the ReportBreakRows which have been generated by this ReportBreak |
int |
hashCode()
Returns a hashCode for this ReportBreak. |
protected void |
initialize(ReportBreak rb)
Initializes this ReportBreak based on another ReportBreak (which must be compatible with this ReportBreak) |
protected void |
initialize(ReportBreakCollection prbc,
java.lang.String pColumnFunctionToken,
java.util.List pFieldNames,
java.lang.String pBreakColumnName)
Initializes a ReportBreak. |
protected boolean |
isAddReportBreakBefore(Row row)
Tests if a report break row should be add to the RowCollection prior to the specified row You can use the getBreakColumn() method (which returns the name of the break column) and the getLastValue() method (which returns the value of the break column field in the previous row) to determine if a report break row should be added. This method is not invoked unless there is at least one row already in the RowCollection |
boolean |
isGenerateReportForSingleRow()
Should reports be generated for a single row? |
boolean |
isOverallReportBreak()
This is not an OverallReportBreak |
Row |
processRow(Row pRow,
RowCollection pRC)
Passes a Row into to one or more column functions, and determines if a ReportBreakRow needs to be positioned prior to that Row |
void |
reset()
Clears all values from all of the column functions |
protected void |
setBreakColumn(java.lang.String newBreakColumn)
Sets the name of the column which this ReportBreak will monitor for breaks. |
protected void |
setColumnFunctions(java.util.List newColumnFunctions)
Sets the List ColumnFunctions which are used to generate ReportBreakRows for this ReportBreak. |
protected void |
setFieldNames(java.util.List pFieldNames)
Sets the column names for this ReportBreak |
protected void |
setGenerateReportForSingleRow(boolean val)
Should reports be generated for a single row? |
protected void |
setLastValue(java.lang.Object newLastValue)
Gets the last value of the field which is being monitored for breaks |
protected void |
setOverallReportBreak(OverallReportBreak pORB)
Sets the OverallReportBreak associated with this ReportBreak |
protected void |
setReportBreakCollection(ReportBreakCollection newReportBreakCollection)
Sets the ReportBreakCollection which contains this ReportBreak |
protected void |
setRows(java.util.List newRows)
Sets a List of the ReportBreakRows which have been generated by this ReportBreak |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ReportBreak()
public ReportBreak(ReportBreakCollection prbc, java.lang.String pColumnFunctionToken, java.util.List pFieldNames, java.lang.String pBreakColumnName) throws DataEngineException
Method Detail |
public java.lang.Object clone()
public ReportBreak cloneReportBreak()
public boolean equals(java.lang.Object o)
protected Row generateReport(java.util.List pFieldDescriptors) throws CMException
CMException
protected Row generateReport(java.util.List pFieldDescriptors, RowCollection rc) throws CMException
CMException
public java.lang.String getBreakColumn()
protected java.util.List getColumnFunctions()
public java.lang.String getColumnFunctionToken()
public java.util.List getFieldNames()
protected java.util.List getFieldNamesInternal()
public int getIndex()
public java.lang.Object getLastValue()
public OverallReportBreak getOverallReportBreak()
public ReportBreakCollection getReportBreakCollection()
public java.util.List getRows()
public int hashCode()
protected void initialize(ReportBreak rb) throws CMException
CMException
protected void initialize(ReportBreakCollection prbc, java.lang.String pColumnFunctionToken, java.util.List pFieldNames, java.lang.String pBreakColumnName) throws DataEngineException
DataEngineException
protected boolean isAddReportBreakBefore(Row row) throws DataEngineException
row
- The row about to be added to the RowCollection
DataEngineException
public boolean isGenerateReportForSingleRow()
public boolean isOverallReportBreak()
public Row processRow(Row pRow, RowCollection pRC) throws CMException
pRow
- A Row that was just added to a RowCollection
pRow
, or
null if no such ReportBreakRow exists.
CMException
public void reset()
protected void setBreakColumn(java.lang.String newBreakColumn)
protected void setColumnFunctions(java.util.List newColumnFunctions)
protected void setFieldNames(java.util.List pFieldNames) throws DataEngineException
DataEngineException
protected void setGenerateReportForSingleRow(boolean val)
protected void setLastValue(java.lang.Object newLastValue)
protected void setOverallReportBreak(OverallReportBreak pORB)
protected void setReportBreakCollection(ReportBreakCollection newReportBreakCollection)
protected void setRows(java.util.List newRows)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |