jdbreport.model
Class BaseRowGroup

java.lang.Object
  extended by jdbreport.model.AbstractGroup
      extended by jdbreport.model.BaseRowGroup
All Implemented Interfaces:
Iterable<TableRow>, Group, RowsGroup
Direct Known Subclasses:
RootRowGroup.RowsGroup

public class BaseRowGroup
extends AbstractGroup
implements RowsGroup

Version:
1.1 03/09/08
Author:
Andrey Kholmanskih

Field Summary
 
Fields inherited from interface jdbreport.model.Group
GROUP_DETAIL, ROW_DETAIL, ROW_FOOTER, ROW_GROUP_FOOTER, ROW_GROUP_HEADER, ROW_NONE, ROW_PAGE_FOOTER, ROW_PAGE_HEADER, ROW_TITLE, typeNames
 
Constructor Summary
BaseRowGroup(GroupsGroup parent, int type)
           
 
Method Summary
 void addRow(int index, TableRow row)
           
 boolean addRow(TableRow row)
           
 void clear()
          Removes all groups and rows from group
 TableRow getChild(int index)
           
 int getChildCount()
           
 int getChildIndex(Object child)
           
protected  List<TableRow> getChildList()
           
 TableRow getFirstGroupRow()
           
 RowsGroup getGroup(TableRow row)
           
 Object getHeaderValue()
           
 int getHeight()
          Returns group's height in pixels
 TableRow getLastGroupRow()
           
protected  TableRow getRow(int row)
           
 int getRowCount()
          Returns all TableRow objects in group
 double getTotalResult(int func, int column)
          Calculates the grand total by column and all rows
protected  double getTotalResult(int func, Iterator<TableRow> it, int column)
           
 int getType()
           
 String getTypeName()
           
 Iterator<TableRow> getVisibleRowIterator()
          Returns all visible rows
 Iterator<TableRow> iterator()
          Returns all rows
 TableRow remove(int index)
           
 boolean remove(Object child)
           
 void updateCellChild(int row, int column)
           
 
Methods inherited from class jdbreport.model.AbstractGroup
getIndexPath, getLevel, getParent, getPath, isVisible, rowTypeToString, setParent, setVisible, stringToRowType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jdbreport.model.Group
getIndexPath, getLevel, getParent, getPath, isVisible, setVisible
 

Constructor Detail

BaseRowGroup

public BaseRowGroup(GroupsGroup parent,
                    int type)
Method Detail

getChildList

protected List<TableRow> getChildList()

getChildIndex

public int getChildIndex(Object child)
Specified by:
getChildIndex in interface Group

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface Group

remove

public boolean remove(Object child)
Specified by:
remove in interface Group

remove

public TableRow remove(int index)
Specified by:
remove in interface RowsGroup

getFirstGroupRow

public TableRow getFirstGroupRow()
Specified by:
getFirstGroupRow in interface Group

getLastGroupRow

public TableRow getLastGroupRow()

getType

public int getType()
Specified by:
getType in interface Group

getTypeName

public String getTypeName()
Specified by:
getTypeName in interface Group

getHeaderValue

public Object getHeaderValue()
Specified by:
getHeaderValue in interface RowsGroup

getRowCount

public int getRowCount()
Description copied from interface: Group
Returns all TableRow objects in group

Specified by:
getRowCount in interface Group
Returns:
all TableRow objects

addRow

public void addRow(int index,
                   TableRow row)
Specified by:
addRow in interface RowsGroup

addRow

public boolean addRow(TableRow row)
Specified by:
addRow in interface RowsGroup

getHeight

public int getHeight()
Description copied from interface: Group
Returns group's height in pixels

Specified by:
getHeight in interface Group
Returns:
the group's height in pixels

getRow

protected TableRow getRow(int row)

updateCellChild

public void updateCellChild(int row,
                            int column)

iterator

public Iterator<TableRow> iterator()
Description copied from interface: Group
Returns all rows

Specified by:
iterator in interface Iterable<TableRow>
Specified by:
iterator in interface Group

getVisibleRowIterator

public Iterator<TableRow> getVisibleRowIterator()
Description copied from interface: Group
Returns all visible rows

Specified by:
getVisibleRowIterator in interface Group
Returns:
all visible rows

getChild

public TableRow getChild(int index)
Specified by:
getChild in interface Group
Specified by:
getChild in interface RowsGroup

getGroup

public RowsGroup getGroup(TableRow row)
Specified by:
getGroup in interface Group

clear

public void clear()
Description copied from interface: Group
Removes all groups and rows from group

Specified by:
clear in interface Group

getTotalResult

public double getTotalResult(int func,
                             int column)
Description copied from interface: Group
Calculates the grand total by column and all rows

Specified by:
getTotalResult in interface Group
Parameters:
func - - the total functions (sum, min, max, avg)
column - - the column's number
Returns:
the grand total by column

getTotalResult

protected double getTotalResult(int func,
                                Iterator<TableRow> it,
                                int column)