Next / Previous / Contents / TCC Help System / NM Tech homepage

29. class Row: Abstract class for logical rows

cbchistlib.py
# - - - - -   c l a s s   R o w

class Row(object):
    '''Base class for logical rows of the detail table.

      Exports:
        Row(cbcHist):
          [ cbcHist is a CbcHist instance ->
              return a new Row instance derived from cbcHist ]
        .cbcHist:          [ as passed to constructor ]
        .nPhysRows(maxPhysCols):
          [ maxPhysCols is a positive int ->
              return the number of physical rows required to render
              self using no more than (maxPhysCols) physical columns ]
        .nPhysCols(maxPhysCols):
          [ maxPhysCols is a positive int ->
              return the number of physical columns required to render
              self using no more than (maxPhysCols) physical columns ]
        .html(sox, maxPhysCols):
          [ (sox is a sox.Sox instance) and
            (maxPhysCols is a positive int) ->
              sox  +:=  a sequence of tr elements representing
                  self folded to fit in maxPhysCols columns, not counting
                  the row label, and tagged with class (cssClass)
                  if given ]                  
        .fo(sox, maxPhysCols):
          [ (sox is a sox.Sox instance) and
            (maxPhysCols is a positive int) ->
              sox  +:=  a sequence of XSL-FO table-row elements
                  representing self folded to fit in maxPhysCols
                  columns, not counting the row label ]
        .suffixes():     # Virtual method
          [ return the suffix cells of self as a sequence of
            Row.N_SUFFIX_COLS instances of Cell ]
        Row.N_SUFFIX_COLS:
          [ number of suffix columns to be generated by subclasses ]

      State/Invariants:
        ._rowLabel:      [ the row label as a RowLabel instance ]
        ._cellList:
          [ the cells in this logical row as a list of (cbcHist.nCols)
            instances ]
    '''
    N_SUFFIX_COLS = 2   # mean and standard deviation

    def suffixes(self):
        raise NotImplementedError("Row.suffixes() is a virtual "
                                  "method.")