jdbreport.model
Class TreeRowGroup

java.lang.Object
  extended by jdbreport.model.AbstractGroup
      extended by jdbreport.model.TreeRowGroup
All Implemented Interfaces:
Iterable<TableRow>, Group, GroupsGroup
Direct Known Subclasses:
DetailGroup, RootGroup

public abstract class TreeRowGroup
extends AbstractGroup
implements GroupsGroup

Version:
2.0 11.05.2011
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
TreeRowGroup(GroupsGroup parent)
           
 
Method Summary
abstract  int addGroup(int index, Group group)
           
protected  RowsGroup createRowGroup(int type)
           
protected  Group findGroup(int type)
           
 Iterator<RowsGroup> getAllGroupIterator()
          Returns all RowsGroup
 Group getChild(int index)
           
 int getChildCount()
           
 int getChildIndex(Object child)
           
protected  List<Group> getChildList()
           
 TableRow getFirstGroupRow()
           
 Group getGroup(int type)
           
 RowsGroup getGroup(TableRow row)
           
 Iterator<Group> getGroupIterator()
           
 int getHeight()
          Returns group's height in pixels
 int getRowCount()
          Returns all TableRow objects in group
 double getTotalResult(int func, int column)
          Calculates the grand total by column and all rows
 Iterator<TableRow> getVisibleRowIterator()
          Returns all visible rows
 Iterator<TableRow> iterator()
          Returns all rows
 boolean remove(Object child)
           
 
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.GroupsGroup
addGroup
 
Methods inherited from interface jdbreport.model.Group
clear, getIndexPath, getLevel, getParent, getPath, getType, getTypeName, isVisible, setVisible
 

Constructor Detail

TreeRowGroup

public TreeRowGroup(GroupsGroup parent)
Method Detail

getGroup

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

addGroup

public abstract int addGroup(int index,
                             Group group)

findGroup

protected Group findGroup(int type)

getChildCount

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

remove

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

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

getChild

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

getFirstGroupRow

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

getGroup

public Group getGroup(int type)
Specified by:
getGroup in interface GroupsGroup

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

createRowGroup

protected RowsGroup createRowGroup(int type)

getChildList

protected List<Group> getChildList()

getChildIndex

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

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

getGroupIterator

public Iterator<Group> getGroupIterator()
Specified by:
getGroupIterator in interface GroupsGroup

getAllGroupIterator

public Iterator<RowsGroup> getAllGroupIterator()
Description copied from interface: GroupsGroup
Returns all RowsGroup

Specified by:
getAllGroupIterator in interface GroupsGroup
Returns:
iterator

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