Class PrintUtils
- java.lang.Object
-
- net.obvj.performetrics.util.print.PrintUtils
-
public class PrintUtils extends Object
This class groups all custom printing operations in a single place.- Author:
- oswaldo.bapvic.jr
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidprint(TimingSessionContainer container, PrintStream printStream)Prints elapsed times from the givenTimingSessionContainerinto the specified print stream.static voidprint(TimingSessionContainer container, PrintStream printStream, PrintStyle printStyle)Prints elapsed times from the givenTimingSessionContainerinto the specified print stream, with a customPrintStyle.static voidprintDetails(TimingSessionContainer container, PrintStream printStream)Prints detailed information about timing sessions from the givenTimingSessionContainerinto the specified print stream.static voidprintDetails(TimingSessionContainer container, PrintStream printStream, PrintStyle printStyle)Prints detailed information about timing sessions from the givenTimingSessionContainerinto the specified print stream, with a customPrintStyle.static voidprintSummary(TimingSessionContainer container, PrintStream printStream)Prints summarized elapsed times from the givenTimingSessionContainerinto the specified print stream.static voidprintSummary(TimingSessionContainer container, PrintStream printStream, PrintStyle printStyle)Prints summarized elapsed times from the givenTimingSessionContainerinto the specified print stream, with a customPrintStyle.static StringtoString(TimingSessionContainer container)Returns a string containing a formatted summary from the givenTimingSessionContainerin default style.static StringtoString(TimingSessionContainer container, PrintStyle printStyle)Returns a string containing a formatted output from the givenTimingSessionContainerin a customPrintStyle.
-
-
-
Method Detail
-
printSummary
public static void printSummary(TimingSessionContainer container, PrintStream printStream)
Prints summarized elapsed times from the givenTimingSessionContainerinto the specified print stream.The default
PrintStyle(defined byPerformetrics.setDefaultPrintStyleForSummary(PrintStyle)) will be applied.- Parameters:
container- theTimingSessionContainerto be printedprintStream- the print stream to which data will be sent- Throws:
NullPointerException- if a nullTimingSessionContaineror print stream is received- Since:
- 2.2.1
-
printSummary
public static void printSummary(TimingSessionContainer container, PrintStream printStream, PrintStyle printStyle)
Prints summarized elapsed times from the givenTimingSessionContainerinto the specified print stream, with a customPrintStyle.- Parameters:
container- theTimingSessionContainerto be printedprintStream- the print stream to which data will be sentprintStyle- thePrintStyle; ifnull, the defaultPrintStyle(defined byPerformetrics.setDefaultPrintStyleForSummary(PrintStyle)) will be applied- Throws:
NullPointerException- if a nullTimingSessionContaineror print stream is receivedIllegalArgumentException- if the specified PrintStyle is not compatible withPrintFormat.SUMMARIZED- Since:
- 2.2.1
-
printDetails
public static void printDetails(TimingSessionContainer container, PrintStream printStream)
Prints detailed information about timing sessions from the givenTimingSessionContainerinto the specified print stream.The default
PrintStyle(defined byPerformetrics.setDefaultPrintStyleForDetails(PrintStyle)) will be applied.- Parameters:
container- theTimingSessionContainerto be printedprintStream- the print stream to which information will be sent- Throws:
NullPointerException- if a nullTimingSessionContaineror print stream is received- Since:
- 2.2.1
-
printDetails
public static void printDetails(TimingSessionContainer container, PrintStream printStream, PrintStyle printStyle)
Prints detailed information about timing sessions from the givenTimingSessionContainerinto the specified print stream, with a customPrintStyle.- Parameters:
container- theTimingSessionContainerto be printedprintStream- the print stream to which information will be sentprintStyle- thePrintStyle; ifnull, the defaultPrintStyle(defined byPerformetrics.setDefaultPrintStyleForDetails(PrintStyle)) will be applied- Throws:
NullPointerException- if a nullTimingSessionContaineror print stream is receivedIllegalArgumentException- if the specifiedPrintStyleis not compatible withPrintFormat.DETAILED- Since:
- 2.2.1
-
print
public static void print(TimingSessionContainer container, PrintStream printStream)
Prints elapsed times from the givenTimingSessionContainerinto the specified print stream.The default
PrintStyle(defined byPerformetrics.setDefaultPrintStyle(PrintStyle)) will be applied.- Parameters:
container- theTimingSessionContainerto be printedprintStream- the print stream to which data will be sent- Throws:
NullPointerException- if a nullTimingSessionContaineror print stream is received- Since:
- 2.4.0
-
print
public static void print(TimingSessionContainer container, PrintStream printStream, PrintStyle printStyle)
Prints elapsed times from the givenTimingSessionContainerinto the specified print stream, with a customPrintStyle.The
PrintFormat(whether to generate a summarized or detailed view) will be determined by the specifiedPrintStyle.- Parameters:
container- theTimingSessionContainerto be printed; not nullprintStream- the print stream to which data will be sent; not nullprintStyle- thePrintStyle; ifnull, the defaultPrintStyle(defined byPerformetrics.setDefaultPrintStyle(PrintStyle)) will be applied- Throws:
NullPointerException- if a nullTimingSessionContaineror print stream is received- Since:
- 2.4.0
-
toString
public static String toString(TimingSessionContainer container)
Returns a string containing a formatted summary from the givenTimingSessionContainerin default style.The default
PrintStyle(defined byPerformetrics.setDefaultPrintStyle(PrintStyle)) will be applied.- Parameters:
container- toTimingSessionContainerto be used; not null- Returns:
- string containing a formatted output from the given
TimingSessionContainer - Since:
- 2.4.0
-
toString
public static String toString(TimingSessionContainer container, PrintStyle printStyle)
Returns a string containing a formatted output from the givenTimingSessionContainerin a customPrintStyle.The
PrintFormat(whether to generate a summarized or detailed view) will be determined by the specifiedPrintStyle.- Parameters:
container- toTimingSessionContainerto be usedprintStyle- thePrintStyle; ifnull, the defaultPrintStyle(defined byPerformetrics.setDefaultPrintStyle(PrintStyle)) will be applied- Returns:
- string containing a formatted output from the given
TimingSessionContainer - Since:
- 2.4.0
-
-