Class NamedValuesColumnFormatter


  • public class NamedValuesColumnFormatter
    extends NamedValuesFormatter
    NamedValuesColumnFormatter is utility class for printing the values in a NamedValues instance as a table.

    For more details see NamedValuesFormatter.

    Author:
    11.11.11 Greg White (greg@slac.stanford.edu) and Chris Larrieu.
    See Also:
    NamedValuesFormatter, NamedValuesRowFormatter
    • Constructor Detail

      • NamedValuesColumnFormatter

        public NamedValuesColumnFormatter()
    • Method Detail

      • getCell

        public String getCell​(int row,
                              int col)
        Description copied from class: NamedValuesFormatter
        Thinking of the namedValues system as a matrix of strings, return a given cell's string data
        Specified by:
        getCell in class NamedValuesFormatter
        Parameters:
        row - Specifies the index of the vector of values that were added to the NamedValues system, starting from 0 being the first name and value vector added.
        col - Specifies the index of a column, where 0 indicates the name, and >0 indicates one of the values associated with that name.
        Returns:
        The cell's string data.
      • getFormattedCell

        public String getFormattedCell​(int row,
                                       int col,
                                       String space)
        Description copied from class: NamedValuesFormatter
        Thinking of the namedValues system as a matrix of strings, return a given cell's string data formatted in a string according to whether the system as a whole would be printed in column or row formatting.
        Specified by:
        getFormattedCell in class NamedValuesFormatter
        Parameters:
        row - Specifies the index of the vector of values that were added to the NamedValues system, starting from 0 being the first name and value vector added.
        col - Specifies the index of a column, where 0 indicates the name, and >0 indicates one of the values associated with that name.
        space - A string into which to put the text. Usually space would be a String of spaces.
        Returns:
        The cell's string data, formatted appropriately as being printed for the system as a whole.
      • isLabelCell

        public boolean isLabelCell​(int row,
                                   int col)
        Description copied from class: NamedValuesFormatter
        Thinking of the namedValues system as a matrix of strings, return whether the given cell is a label cell or not. Basically, if the system is column oriented, is it the first row.
        Specified by:
        isLabelCell in class NamedValuesFormatter
        Parameters:
        row - the row of the cell
        col - the column of the cell
        Returns:
        true if the cell value should be treated as a label.
      • updateDimensions

        public void updateDimensions()
        Description copied from class: NamedValuesFormatter
        Thinking of the namedValues system as a matrix of strings, reset the internal row and column count based on things like whether labels would be printed (if not, that's one less row).
        Specified by:
        updateDimensions in class NamedValuesFormatter