de.hpi.fgis.dude.output.statisticoutput
Interface StatisticOutput

All Superinterfaces:
AutoJsonable
All Known Implementing Classes:
AbstractStatisticOutput, CSVStatisticOutput, SimpleStatisticOutput

public interface StatisticOutput
extends AutoJsonable

StatisticOutput offers all methods needed to write out the statistics provided by a StatisticComponent instance.

Author:
Fabian Lindenberg

Method Summary
 void close()
          Closes the underlying stream.
 String[] getLabels()
          Returns the labels for the measurements.
 StatisticComponent getStatistics()
          Returns the current statistic component that is used by the output.
 void resetOptionalStatisticEntries()
          Resets the values of all optional labels using empty Strings.
 boolean setOptionalStatisticEntry(String label)
          Sets a new optional label with no value.
 boolean setOptionalStatisticEntry(String label, String value)
          Sets a new optional label with the passed value.
 void setStatistics(StatisticComponent statistics)
          Sets the current statistic component that is used by the output.
 void writeStatistics()
          Writes the stored statistics.
 

Method Detail

writeStatistics

void writeStatistics()
                     throws IOException
Writes the stored statistics. May throw an IOException.

Throws:
IOException - If an error occurs while writing to the output.

getLabels

String[] getLabels()
Returns the labels for the measurements.

Returns:
An array of Strings containing all labels that are used during the print-out.

getStatistics

StatisticComponent getStatistics()
Returns the current statistic component that is used by the output.

Returns:
Current StatisticComponent.

setStatistics

void setStatistics(StatisticComponent statistics)
Sets the current statistic component that is used by the output.

Parameters:
statistics - StatisticComponent that is to be set.

resetOptionalStatisticEntries

void resetOptionalStatisticEntries()
Resets the values of all optional labels using empty Strings. The columns are not removed.


setOptionalStatisticEntry

boolean setOptionalStatisticEntry(String label,
                                  String value)
Sets a new optional label with the passed value.

Parameters:
label - The entry's identifier.
value - The entry's value.
Returns:
true, if a new statistic entry was added (no old value was overwritten); otherwise false.

setOptionalStatisticEntry

boolean setOptionalStatisticEntry(String label)
Sets a new optional label with no value.

Parameters:
label - The entry's identifier.
Returns:
true, if a new statistic entry was added (no old value was overwritten); otherwise false.

close

void close()
           throws IOException
Closes the underlying stream.

Throws:
IOException - If an error occurs while closing the underlying stream.


Copyright © 2011 Hasso Plattner Institute - Chair of Information Systems. All Rights Reserved.