org.javasimon.utils
Class SampleHtmlGenerator

java.lang.Object
  extended by org.javasimon.utils.SampleHtmlGenerator

public class SampleHtmlGenerator
extends Object

Generates HTML table for the provided Samples. Lines are separated by the default line separator (current value of System.getProperty("line.separator")).


Field Summary
private  StringBuilder builder
           
private static String lineSeparator
           
private  Iterable<Sample> samples
           
 
Constructor Summary
private SampleHtmlGenerator(Iterable<Sample> samples)
           
 
Method Summary
private  void buildHeader()
           
private  void buildRowForSample(Sample sample)
           
static String generate(Iterable<Sample> samples)
          Generates HTML table for the provided Samples.
static String generate(Sample... samples)
          Generates HTML table for the provided Samples.
private  StringBuilder indent(int count)
           
static void setLineSeparator(String newLineSeparator)
          Sets the line separator to desired string.
private  String toHtmlTable()
          Generates HTML table for the provided Samples.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lineSeparator

private static String lineSeparator

samples

private final Iterable<Sample> samples

builder

private final StringBuilder builder
Constructor Detail

SampleHtmlGenerator

private SampleHtmlGenerator(Iterable<Sample> samples)
Method Detail

generate

public static String generate(Sample... samples)
Generates HTML table for the provided Samples.

Parameters:
samples - vararg array of Samples
Returns:
HTML output for the samples

generate

public static String generate(Iterable<Sample> samples)
Generates HTML table for the provided Samples.

Parameters:
samples - iterable of Samples
Returns:
HTML output for the samples

toHtmlTable

private String toHtmlTable()
Generates HTML table for the provided Samples.

Returns:
HTML output for the samples

buildHeader

private void buildHeader()

buildRowForSample

private void buildRowForSample(Sample sample)

indent

private StringBuilder indent(int count)

setLineSeparator

public static void setLineSeparator(String newLineSeparator)
Sets the line separator to desired string. Default value is System.getProperty("line.separator").

Parameters:
newLineSeparator - new line separator string


Copyright © 2013. All Rights Reserved.