Enum PrintFormat

  • All Implemented Interfaces:
    Serializable, Comparable<PrintFormat>

    public enum PrintFormat
    extends Enum<PrintFormat>
    Provides different formatters for printing data from a timing-session container as strings in tabular layout.
    Since:
    2.2.1
    Author:
    oswaldo.bapvic.jr
    • Enum Constant Detail

      • SUMMARIZED

        public static final PrintFormat SUMMARIZED
        Generates a summarized view which represents the total elapsed time for each counter type available in the timing-session container, one row for each type.

        Sample output (applying PrintStyle.SUMMARIZED_TABLE_FULL):

         ====================================
         Counter                 Elapsed time
         ------------------------------------
         Wall clock time    0:00:04.455383500
         CPU time           0:00:00.109375000
         User time          0:00:00.046875000
         System time        0:00:00.062500000
         ====================================
         

        Note: Since 2.4.0, some counter types may be excluded from the actual output if specified by the PrintStyle to be applied.

        See Also:
        PrintStyle
      • DETAILED

        public static final PrintFormat DETAILED
        Generates a detailed view of each counter type and timing session available in the timing-session container, one row for each timing session, and the total elapsed time for each type, as well.

        Sample output (applying PrintStyle.DETAILED_TABLE_FULL):

         ===============================================
             #         Elapsed time     Elapsed time (+)
         ===============================================
         Wall clock time
         -----------------------------------------------
             0    0:00:01.055824100    0:00:01.055824100
             1    0:00:00.836569500    0:00:01.892393600
             2    0:00:00.836091100    0:00:02.728484700
             3    0:00:00.837092700    0:00:03.565577400
         -----------------------------------------------
         TOTAL                         0:00:03.565577400
         ===============================================
         CPU time
         -----------------------------------------------
             0    0:00:00.109375000    0:00:00.109375000
             1    0:00:00.000000000    0:00:00.109375000
             2    0:00:00.000000000    0:00:00.109375000
             3    0:00:00.015625000    0:00:00.125000000
         -----------------------------------------------
         TOTAL                         0:00:00.125000000
         ===============================================
         
        See Also:
        PrintStyle
    • Method Detail

      • values

        public static PrintFormat[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (PrintFormat c : PrintFormat.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PrintFormat valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • format

        public abstract String format​(TimingSessionContainer container,
                                      PrintStyle style)
        Generates a formatted string containing data from the specified timing-session container, in a custom style.
        Parameters:
        container - the timing-session container to be printed
        style - the PrintStyle to be applied
        Returns:
        a string with formatted data from the container
        Throws:
        IllegalArgumentException - if the specified PrintStyle is not compatible with this PrintFormat.