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_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 use with the detailed stopwatch formatter, with horizontal
lines separating each row, and total elapsed time for each counter.
|
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_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.
|
| 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() |
DurationFormat |
getDurationFormat() |
String |
getHeaderFormat() |
PrintFormat |
getPrintFormat() |
String |
getRowFormat() |
String |
getSectionHeaderFormat() |
String |
getSectionSummaryRowFormat() |
String |
getSimpleLine() |
boolean |
isPrintHeader() |
boolean |
isPrintLegend() |
boolean |
isPrintSectionSummary() |
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 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 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()
PrintFormatpublic DurationFormat getDurationFormat()
DurationFormat to be applied on all rowspublic boolean isPrintLegend()
public boolean isPrintHeader()
public boolean isPrintSectionSummary()
public String getHeaderFormat()
public String getRowFormat()
public String getSectionHeaderFormat()
public String getSectionSummaryRowFormat()
public String getSimpleLine()
public String getAlternativeLine()
Copyright © 2021. All rights reserved.