Class RMTableRPGX

  • All Implemented Interfaces:
    RMArchiver.Archiving, java.lang.Cloneable

    public class RMTableRPGX
    extends RMTableRPG
    This class is a subclass of the basic implementation of Table RPG. It provides additional support to handle advanced pagination, with widow/orphan control, running summaries, etc.

    Whereas the superclass had the luxury of simple breadth first iteration over the group tree, this class must do a much more complicated depth transversal, so it can remove rows in the reverse order they were added.

    • Constructor Detail

      • RMTableRPGX

        public RMTableRPGX()
        Creates an empty TableRPGX to be used as a container for a page of filled table rows.
      • RMTableRPGX

        public RMTableRPGX​(RMTableGroup aTableGroup,
                           RMTable aTable,
                           ReportMill aReportMill)
        Creates a TableRPGX and starts the RPG process with the given TableGroup or Table.
    • Method Detail

      • addTable

        public void addTable​(RMTable aTable)
        This is a top level method to fill rows in the current page and kick off a new page if it ends prematurly.
      • addTable

        public boolean addTable​(RMTable aTable,
                                RMGroup aSource,
                                int stayWith)
        This method adds a given table (or sub-table) to the current page.
      • addHeader

        public boolean addHeader​(RMGroup aGroup,
                                 int stayWith)
        In theory, this method just adds a header row for the given group and then hands off to addDetails for it's first subgroup. If we successfully add a header row, we return true.

        However, if the given group isEmpty, we simply progress to addSummary.

        Additionally, if there is an existing _starupGroup, we print a "Reprint" header and we derive a specific subgroup for our addDetails hand off (the specific subgroup that is a parent of _startupGroup).

      • addDetails

        public boolean addDetails​(RMGroup aGroup,
                                  int stayWith)
        In theory, this method just adds a details row for the given group and then hands off to addHeader for sub-group addition. If we successfully add a details row, we returns true.

        However, if aGroup isLeaf we try to either addTable for a child table (if present) or addDetails for the next details (if present) or addSummary for parent (if aGroup truly is the last of it's line).

        Additionally, if we failed to add a child group, a child table or a next group, we check our stayWith constraints and either remove ourselves or try to addSummary(s) for running summaries.

        One final wrinkle - we may actually only add a portion of the details row for this group. If that happens, we try to addSummary for upper groups (for running summaries).

      • addSummary

        public boolean addSummary​(RMGroup aGroup,
                                  int detailIndex)
        In theory, this method just adds a summary row for the given group and then hands off to addDetails for aGroup's next peer. If we successfully add a summary row, we returns true.
      • addRow

        public boolean addRow​(RMTableRowRPG aRow)
        Description copied from class: RMTableRPG
        Adds the given table row RPG to this table RPG (just below the last child).
        Overrides:
        addRow in class RMTableRPG
      • splitRow

        public RMTableRowRPG splitRow​(RMTableRowRPG aRow)
        Splits the given row at the point that it overlaps its next neighbor or row bottom.