org.ujac.util.table
Class ReportGroup

java.lang.Object
  extended by org.ujac.util.table.ReportGroup
All Implemented Interfaces:
Serializable, Cloneable

public class ReportGroup
extends Object
implements Cloneable, Serializable

Name: ReportGroup
Description: A class describing and managing report groups.

Author:
lauerc
See Also:
Serialized Form

Constructor Summary
ReportGroup(String columnName)
          Constructs a ReportGroup instance with specific attributes.
ReportGroup(String columnName, boolean viewTitleRow, boolean resultsInTitleRow, boolean hideAtSucceedingRows, boolean startNewPage)
          Constructs a ReportGroup instance with specific attributes.
ReportGroup(String columnName, boolean viewTitleRow, boolean resultsInTitleRow, boolean hideAtSucceedingRows, boolean startNewPage, boolean keepTogether)
          Constructs a ReportGroup instance with specific attributes.
 
Method Summary
protected  void applyFunction(int columnId, FunctionExecutor executor, Object operand)
          Applies the given report function executor on the given column.
protected  Object clone()
           
 int getColumnIdx()
          Getter method for the the property columnIdx.
 String getColumnName()
          Gets the column name.
 double getGroupResult(int columnId)
          Getter method for the the property groupResult.
 double[] getGroupResults()
          Getter method for the the property groupResult.
protected  Row getTitleRow()
          Getter method for the the property titleRow.
protected  void init(ReportTable report)
          Initializes the report group.
 boolean isEnforceResultRow()
          Getter method for the the property enforceResultRow.
protected  boolean isFunctionsApplied()
          Getter method for the the property functionsApplied.
protected  boolean isFunctionsApplied(int columnId)
          Getter method for the the property functionsApplied.
 boolean isHideAtSucceedingRows()
          Getter method for the the property hideAtSucceedingRows.
 boolean isKeepTogether()
          Getter method for the the property keepTogether.
 boolean isResultsInTitleRow()
          Getter method for the the property resultsInTitleRow.
 boolean isStartNewPage()
          Getter method for the the property startNewPage.
 boolean isViewTitleRow()
          Getter method for the the property viewTitleRow.
protected  void reset()
          Resets the report group.
protected  ReportGroup setColumnIdx(int columnIdx)
          Setter method for the the property columnIdx.
 ReportGroup setEnforceResultRow(boolean enforceResultRow)
          Setter method for the the property enforceResultRow.
 ReportGroup setHideAtSucceedingRows(boolean hideAtSucceedingRows)
          Setter method for the the property hideAtSucceedingRows.
 ReportGroup setKeepTogether(boolean keepTogether)
          Setter method for the the property keepTogether.
 ReportGroup setResultsInTitleRow(boolean resultsInTitleRow)
          Setter method for the the property resultsInTitleRow.
 ReportGroup setStartNewPage(boolean startNewPage)
          Setter method for the the property startNewPage.
protected  void setTitleRow(Row titleRow)
          Setter method for the the property titleRow.
 ReportGroup setViewTitleRow(boolean viewTitleRow)
          Setter method for the the property viewTitleRow.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReportGroup

public ReportGroup(String columnName)
Constructs a ReportGroup instance with specific attributes.

Parameters:
columnName - The column name.

ReportGroup

public ReportGroup(String columnName,
                   boolean viewTitleRow,
                   boolean resultsInTitleRow,
                   boolean hideAtSucceedingRows,
                   boolean startNewPage)
Constructs a ReportGroup instance with specific attributes.

Parameters:
columnName - The column name.
viewTitleRow - The view title row flag.
resultsInTitleRow - The results in title row flag.
hideAtSucceedingRows - Tells whether or not to hide the grouped column at succeeding rows. If true, only the first row is shown the succeeding ones are hidden.
startNewPage - Tells whether or not to start a new page if a change of the value at the grouping column is detected.

ReportGroup

public ReportGroup(String columnName,
                   boolean viewTitleRow,
                   boolean resultsInTitleRow,
                   boolean hideAtSucceedingRows,
                   boolean startNewPage,
                   boolean keepTogether)
Constructs a ReportGroup instance with specific attributes.

Parameters:
columnName - The column name.
viewTitleRow - The view title row flag.
resultsInTitleRow - The results in title row flag.
hideAtSucceedingRows - Tells whether or not to hide the grouped column at succeeding rows. If true, only the first row is shown the succeeding ones are hidden.
startNewPage - Tells whether or not to start a new page if a change of the value at the grouping column is detected.
keepTogether - Tells whether or not to try to keep the grouped rows together on one page.
Method Detail

getColumnName

public String getColumnName()
Gets the column name.

Returns:
The name of the column to apply the function on.

isViewTitleRow

public boolean isViewTitleRow()
Getter method for the the property viewTitleRow.

Returns:
The current value of property viewTitleRow.

setViewTitleRow

public ReportGroup setViewTitleRow(boolean viewTitleRow)
Setter method for the the property viewTitleRow.

Parameters:
viewTitleRow - The value to set for the property viewTitleRow.
Returns:
The reference to this instance.

isResultsInTitleRow

public boolean isResultsInTitleRow()
Getter method for the the property resultsInTitleRow.

Returns:
The current value of property resultsInTitleRow.

setResultsInTitleRow

public ReportGroup setResultsInTitleRow(boolean resultsInTitleRow)
Setter method for the the property resultsInTitleRow.

Parameters:
resultsInTitleRow - The value to set for the property resultsInTitleRow.
Returns:
The reference to this instance.

isHideAtSucceedingRows

public boolean isHideAtSucceedingRows()
Getter method for the the property hideAtSucceedingRows.

Returns:
The current value of property hideAtSucceedingRows.

setHideAtSucceedingRows

public ReportGroup setHideAtSucceedingRows(boolean hideAtSucceedingRows)
Setter method for the the property hideAtSucceedingRows.

Parameters:
hideAtSucceedingRows - The value to set for the property hideAtSucceedingRows.
Returns:
The reference to this instance.

isStartNewPage

public boolean isStartNewPage()
Getter method for the the property startNewPage.

Returns:
The current value of property startNewPage.

setStartNewPage

public ReportGroup setStartNewPage(boolean startNewPage)
Setter method for the the property startNewPage.

Parameters:
startNewPage - The value to set for the property startNewPage.
Returns:
The reference to this instance.

isKeepTogether

public boolean isKeepTogether()
Getter method for the the property keepTogether.

Returns:
The current value of property keepTogether.

setKeepTogether

public ReportGroup setKeepTogether(boolean keepTogether)
Setter method for the the property keepTogether.

Parameters:
keepTogether - The value to set for the property keepTogether.
Returns:
The reference to this instance.

isEnforceResultRow

public boolean isEnforceResultRow()
Getter method for the the property enforceResultRow.

Returns:
The current value of property enforceResultRow.

setEnforceResultRow

public ReportGroup setEnforceResultRow(boolean enforceResultRow)
Setter method for the the property enforceResultRow.

Parameters:
enforceResultRow - The value to set for the property enforceResultRow.
Returns:
The reference to this instance.

getColumnIdx

public int getColumnIdx()
Getter method for the the property columnIdx.

Returns:
The current value of property columnIdx.

setColumnIdx

protected ReportGroup setColumnIdx(int columnIdx)
Setter method for the the property columnIdx.

Parameters:
columnIdx - The value to set for the property columnIdx.
Returns:
The reference to this instance.

getGroupResults

public double[] getGroupResults()
Getter method for the the property groupResult.

Returns:
The current value of property groupResult.

getGroupResult

public double getGroupResult(int columnId)
Getter method for the the property groupResult.

Parameters:
columnId - The column ID for which to retrieve the result.
Returns:
The current value of property groupResult.

isFunctionsApplied

protected boolean isFunctionsApplied()
Getter method for the the property functionsApplied.

Returns:
The current value of property functionsApplied.

isFunctionsApplied

protected boolean isFunctionsApplied(int columnId)
Getter method for the the property functionsApplied.

Parameters:
columnId - The column ID for which to set the result.
Returns:
The current value of property functionsApplied.

applyFunction

protected void applyFunction(int columnId,
                             FunctionExecutor executor,
                             Object operand)
                      throws TypeMismatchException
Applies the given report function executor on the given column.

Parameters:
columnId - The column ID for which to set the result.
executor - The report function executor to apply.
operand - The value to set for the property groupResult.
Throws:
TypeMismatchException - In case the given operand type was invalid.

getTitleRow

protected Row getTitleRow()
Getter method for the the property titleRow.

Returns:
The current value of property titleRow.

setTitleRow

protected void setTitleRow(Row titleRow)
Setter method for the the property titleRow.

Parameters:
titleRow - The value to set for the property titleRow.

init

protected void init(ReportTable report)
Initializes the report group.

Parameters:
report - The report to set.

reset

protected void reset()
Resets the report group. Sets all result values to zero.


clone

protected Object clone()
Overrides:
clone in class Object
See Also:
Object.clone()

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2003-2004 UJAC.org. All Rights Reserved.