public class PrintStyle extends Object
PrintFormat to generate a String output
out of a Stopwatch object.| Modifier and Type | Field and Description |
|---|---|
static PrintStyle |
DETAILED_CSV
A string-based style for the detailed stopwatch formatter, which prints data
as CSV (comma-separated values).
|
static PrintStyle |
DETAILED_CSV_ISO_8601
A string-based style for the detailed stopwatch formatter, which prints data as
CSV (comma-separated values), with elapsed times expressed using the ISO-8601 duration
format.
|
static PrintStyle |
DETAILED_CSV_ISO_8601_NO_HEADER
A string-based style for the detailed stopwatch formatter, which prints data as
CSV (comma-separated values), with elapsed times expressed using the ISO-8601 duration
format and no header.
|
static PrintStyle |
DETAILED_CSV_NO_HEADER
A string-based style for the detailed stopwatch formatter, which prints data
as CSV (comma-separated values), without header.
|
static PrintStyle |
DETAILED_TABLE_FULL
A string-based style for the detailed stopwatch formatter, with horizontal lines
separating each row, and total elapsed time for each counter.
|
static PrintStyle |
DETAILED_XML
A string-based style for the detailed stopwatch formatter, which prints data in
XML format.
|
static PrintStyle |
DETAILED_XML_ISO_8601
A string-based style for the detailed stopwatch formatter, which prints data as
XML with elapsed times expressed using the ISO-8601 duration format.
|
static PrintStyle |
SUMMARIZED_CSV
A string-based style for the summarized stopwatch formatter, which prints data
as CSV (comma-separated values).
|
static PrintStyle |
SUMMARIZED_CSV_ISO_8601
A string-based style for the summarized stopwatch formatter, which prints data
as CSV (comma-separated values), with elapsed times expressed using the ISO-8601
duration format.
|
static PrintStyle |
SUMMARIZED_CSV_ISO_8601_NO_HEADER
A string-based style for the summarized stopwatch formatter, which prints data
as CSV (comma-separated values), with elapsed times expressed using the ISO-8601
duration format and no header.
|
static PrintStyle |
SUMMARIZED_CSV_NO_HEADER
A string-based style for the summarized stopwatch formatter, which prints data
as CSV (comma-separated values), without header.
|
static PrintStyle |
SUMMARIZED_TABLE_FULL
A string-based style for the summarized stopwatch formatter, which prints data
in tabular format, with horizontal lines separating each row.
|
static PrintStyle |
SUMMARIZED_TABLE_NO_HEADER
A string-based style for the summarized stopwatch formatter, which prints data
in tabular format without header.
|
static PrintStyle |
SUMMARIZED_XML
A string-based style for the summarized stopwatch formatter, which prints data
in XML format.
|
static PrintStyle |
SUMMARIZED_XML_ISO_8601
A string-based style for the summarized stopwatch formatter, which prints data
as XML with elapsed times expressed using the ISO-8601 duration format.
|
| Modifier and Type | Method and Description |
|---|---|
static PrintStyleBuilder |
builder(PrintFormat printFormat)
Returns an empty PrintStyle builder.
|
static PrintStyleBuilder |
builder(PrintStyle source)
Returns a PrintStyle builder with the same attributes of an existing PrintStyle.
|
String |
getAlternativeLine()
Returns an alternative string to be applied to the table style.
|
DurationFormat |
getDurationFormat()
Returns the format to be applied to all durations in the output.
|
String |
getHeaderFormat()
Returns the format to be applied to the header string of the output.
|
PrintFormat |
getPrintFormat()
Returns the target
PrintFormat. |
String |
getRowFormat()
Returns the general row format to be applied.
|
String |
getSectionHeaderFormat()
Returns the format to be applied to each section header.
|
String |
getSectionSummaryRowFormat()
Returns the format to be applied to the total/summary row for each section.
|
String |
getSectionTrailerFormat()
Returns the format to be applied to the trailer row for each section.
|
String |
getSimpleLine()
Returns a simple string to be applied to the table style.
|
String |
getTrailerFormat()
Returns the format to be applied to the trailer string of the output.
|
boolean |
isPrintHeader()
Returns a flag indicating whether or not the header shall be printed.
|
boolean |
isPrintLegend()
Returns a flag indicating whether or not duration legends shall be printed for
durations in the output.
|
boolean |
isPrintSectionSummary()
Returns a flag indicating whether or not a summary line shall be printed for each
section in the output.
|
boolean |
isPrintSectionTrailer()
Returns a flag indicating whether or not a trailer line shall be printed for each
section in the output.
|
boolean |
isPrintTrailer()
Returns a flag indicating whether or not the trailer shall be printed.
|
public static final PrintStyle SUMMARIZED_TABLE_NO_HEADER
Sample output:
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
PrintFormat.SUMMARIZEDpublic static final PrintStyle SUMMARIZED_TABLE_FULL
Sample output:
==================================== 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 ====================================
PrintFormat.SUMMARIZEDpublic static final PrintStyle SUMMARIZED_CSV
Sample output:
"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"
PrintFormat.SUMMARIZEDpublic static final PrintStyle SUMMARIZED_CSV_NO_HEADER
Sample output:
"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"
PrintFormat.SUMMARIZEDpublic static final PrintStyle SUMMARIZED_CSV_ISO_8601
Sample output:
"Counter","Elapsed time" "Wall clock time","PT4.4553835S" "CPU time","PT0.109375S" "User time","PT0.046875S" "System time","PT0.0625S"
DurationFormat.ISO_8601,
PrintFormat.SUMMARIZEDpublic static final PrintStyle SUMMARIZED_CSV_ISO_8601_NO_HEADER
Sample output:
"Wall clock time","PT4.4553835S" "CPU time","PT0.109375S" "User time","PT0.046875S" "System time","PT0.0625S"
DurationFormat.ISO_8601,
PrintFormat.SUMMARIZEDpublic static final PrintStyle SUMMARIZED_XML
Sample output:
<counters><counter type="Wall clock time">0:00:01.352886500</counter><counter type="CPU time">0:00:00.062500000</counter><counter type="User time">0:00:00.031250000</counter><counter type="System time">0:00:00.031250000</counter></counters>
PrintFormat.SUMMARIZEDpublic static final PrintStyle SUMMARIZED_XML_ISO_8601
Sample output:
<counters><counter type="Wall clock time">PT1.3528865S</counter><counter type="CPU time">PT0.0625S</counter><counter type="User time">PT0.03125S</counter><counter type="System time">PT0.03125S</counter></counters>
DurationFormat.ISO_8601,
PrintFormat.SUMMARIZEDpublic static final PrintStyle DETAILED_TABLE_FULL
Sample output:
===============================================
# Elapsed time Elapsed time (+)
===============================================
Wall clock time
-----------------------------------------------
1 0:00:01.055824100 0:00:01.055824100
2 0:00:00.836569500 0:00:01.892393600
3 0:00:00.836091100 0:00:02.728484700
4 0:00:00.837092700 0:00:03.565577400
-----------------------------------------------
TOTAL 0:00:03.565577400
===============================================
CPU time
-----------------------------------------------
1 0:00:00.109375000 0:00:00.109375000
2 0:00:00.000000000 0:00:00.109375000
3 0:00:00.000000000 0:00:00.109375000
4 0:00:00.015625000 0:00:00.125000000
-----------------------------------------------
TOTAL 0:00:00.125000000
===============================================
PrintFormat.DETAILEDpublic static final PrintStyle DETAILED_CSV
Sample output:
"Counter","Session","Elapsed time","Elapsed time (+)" "Wall clock time",1,"0:00:00.032319200","0:00:00.032319200" "Wall clock time",2,"0:00:00.016766500","0:00:00.049085700" "Wall clock time",3,"0:00:00.014459500","0:00:00.063545200" "CPU time",1,"0:00:00.031250000","0:00:00.031250000" "CPU time",2,"0:00:00.015625000","0:00:00.046875000" "CPU time",3,"0:00:00.015625000","0:00:00.062500000"
PrintFormat.DETAILEDpublic static final PrintStyle DETAILED_CSV_NO_HEADER
Sample output:
"Wall clock time",1,"0:00:00.032319200","0:00:00.032319200" "Wall clock time",2,"0:00:00.016766500","0:00:00.049085700" "Wall clock time",3,"0:00:00.014459500","0:00:00.063545200" "CPU time",1,"0:00:00.031250000","0:00:00.031250000" "CPU time",2,"0:00:00.015625000","0:00:00.046875000" "CPU time",3,"0:00:00.015625000","0:00:00.062500000"
PrintFormat.DETAILEDpublic static final PrintStyle DETAILED_CSV_ISO_8601
Sample output:
"Counter","Session","Elapsed time","Elapsed time (+)" "Wall clock time",1,"PT0.0323192S","PT0.0323192S" "Wall clock time",2,"PT0.0167665S","PT0.0490857S" "CPU time",1,"PT0.03125S","PT0.03125S" "CPU time",2,"PT0.015625S","PT0.046875S"
DurationFormat.ISO_8601,
PrintFormat.DETAILEDpublic static final PrintStyle DETAILED_CSV_ISO_8601_NO_HEADER
Sample output:
"Wall clock time",1,"PT0.0323192S","PT0.0323192S" "Wall clock time",2,"PT0.0167665S","PT0.0490857S" "CPU time",1,"PT0.03125S","PT0.03125S" "CPU time",2,"PT0.015625S","PT0.046875S"
DurationFormat.ISO_8601,
PrintFormat.DETAILEDpublic static final PrintStyle DETAILED_XML
Sample output:
<counters><counter type="Wall clock time"><session sequence="1">0:00:01.371288100</session><session sequence="2">0:00:01.103620000</session><total>0:00:02.474908100</total></counter><counter type="CPU time"><session sequence="1">0:00:00.031250000</session><session sequence="2">0:00:00.015625000</session><total>0:00:00.046875000</total></counter></counters>
PrintFormat.DETAILEDpublic static final PrintStyle DETAILED_XML_ISO_8601
Sample output:
<counters><counter type="Wall clock time"><session sequence="1">PT1.357239099S</session><session sequence="2">PT1.1036874</session><total>PT2.460926499S</total></counter><counter type="CPU time"><session sequence="1">PT0.1875S</session><session sequence="2">PT0.015625S</session><total>PT0.203125S</total></counter></counters>
DurationFormat.ISO_8601,
PrintFormat.DETAILEDpublic static PrintStyleBuilder builder(PrintFormat printFormat)
printFormat - the target PrintFormat, not nullPrintStyleBuilder instanceNullPointerException - if the specified PrintFormat is nullpublic static PrintStyleBuilder builder(PrintStyle source)
source - the PrintStyle whose attributes are to be copiedPrintStyleBuilder instance with the same attributes of the
specified source objectNullPointerException - if the specified PrintStyle is nullpublic PrintFormat getPrintFormat()
PrintFormat.PrintFormatpublic DurationFormat getDurationFormat()
DurationFormat to be applied to all rowspublic boolean isPrintLegend()
public boolean isPrintHeader()
public boolean isPrintTrailer()
public boolean isPrintSectionSummary()
public boolean isPrintSectionTrailer()
public String getHeaderFormat()
public String getTrailerFormat()
public String getRowFormat()
public String getSectionHeaderFormat()
public String getSectionSummaryRowFormat()
public String getSectionTrailerFormat()
public String getSimpleLine()
public String getAlternativeLine()
Copyright © 2022. All rights reserved.