Class FormattedMapStatementResult

  • All Implemented Interfaces:
    StatementResult

    public class FormattedMapStatementResult
    extends DefaultStatementResult
    An implementation of a StatementResult which assumes the result is a Map with value being a Object or Object[]. The caller may call setColumnHeaders to set the column header values and the formatting of the results will be based upon the largest value in each column.
    Since:
    12.2.1
    Author:
    tam 2014.08.05
    • Constructor Detail

      • FormattedMapStatementResult

        public FormattedMapStatementResult​(Object oResult)
        Construct an instance with the given result which will should be a Map. If the result is not a Map then it is just output using super class.
        Parameters:
        oResult - the result
    • Method Detail

      • printResultsObjectMap

        protected void printResultsObjectMap​(PrintWriter writer,
                                             Map map,
                                             boolean fShowKey)
        Print the contents of the specified Map to the specified PrintWriter and format as required. The Map is assumed to have values of either Object or Object[].
        Parameters:
        writer - a PrintWriter to print on
        map - the Map to print
        fShowKey - a flag controlling whether to print the Maps keys
      • setColumnHeaders

        public void setColumnHeaders​(String[] asColumnHeaders)
        Set the column headers to print.
        Parameters:
        asColumnHeaders - the column headers to print