Class OperationHistoryLogger

    • Constructor Detail

      • OperationHistoryLogger

        public OperationHistoryLogger​(PrintWriter writer)
        Creates an OperationHistoryLogger that will write to the given PrintWriter.
        Parameters:
        writer - the PrintWriter for writing the table from the created operation history
    • Method Detail

      • printHeader

        private Map<OperationOutcome,​String> printHeader​(int firstColumnLength)
        Writes the header for the operation history table, and constructs a map of format strings for the columns of the table matching the length of the outcome names.
        Parameters:
        firstColumnLength - the width to use for the first column
        Returns:
        a map from OperationOutcome value to numeric column format for subsequent rows
      • printRow

        private void printRow​(int firstColumnLength,
                              Map<OperationOutcome,​String> formatMap,
                              TypedOperation operation,
                              EnumMap<OperationOutcome,​Integer> countMap)
        Writes a row for a particular operation consisting of the operation signature and the counts of sequences for each outcome.
        Parameters:
        firstColumnLength - the width to use for the first column
        formatMap - the map of format strings for the counts for each outcome
        operation - the operation for the row
        countMap - the map of counts for the operation and each outcome