|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.output.statisticoutput.AbstractStatisticOutput
public abstract class AbstractStatisticOutput
AbstractStatisticOuput
is an abstract
class that provides functionality common to most classes implementing
StatisticOutput
. Every concrete StatisticOutput
implementation may inherit from this class instead of implementing the
StatisticOutput
interface itself.
Field Summary | |
---|---|
protected static String[] |
defaultLabels
Default labels. |
Constructor Summary | |
---|---|
protected |
AbstractStatisticOutput()
Internal constructor for Jsonable deserialization. |
|
AbstractStatisticOutput(StatisticComponent statsComponent)
Initializes a AbstractStatisticOutput with the passed StatisticComponent . |
Method Summary | |
---|---|
abstract void |
close()
Closes the underlying stream. |
String[] |
getLabels()
Returns the labels for the measurements. |
protected Map<String,String> |
getOptionalEntries()
Returns all extension columns' label and value. |
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. |
abstract void |
writeStatistics()
Writes the stored statistics. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String[] defaultLabels
Constructor Detail |
---|
public AbstractStatisticOutput(StatisticComponent statsComponent)
AbstractStatisticOutput
with the passed StatisticComponent
.
statsComponent
- The StatisticComponent
whose data shall be printed.protected AbstractStatisticOutput()
Jsonable
deserialization.
Method Detail |
---|
public abstract void writeStatistics() throws IOException
StatisticOutput
writeStatistics
in interface StatisticOutput
IOException
- If an error occurs while writing to the output.public abstract void close() throws IOException
StatisticOutput
close
in interface StatisticOutput
IOException
- If an error occurs while closing the underlying stream.public String[] getLabels()
StatisticOutput
getLabels
in interface StatisticOutput
public StatisticComponent getStatistics()
StatisticOutput
getStatistics
in interface StatisticOutput
StatisticComponent
.public void setStatistics(StatisticComponent statistics)
StatisticOutput
setStatistics
in interface StatisticOutput
statistics
- StatisticComponent
that is to be set.public void resetOptionalStatisticEntries()
StatisticOutput
resetOptionalStatisticEntries
in interface StatisticOutput
public boolean setOptionalStatisticEntry(String label, String value)
StatisticOutput
setOptionalStatisticEntry
in interface StatisticOutput
label
- The entry's identifier.value
- The entry's value.
true
, if a new statistic entry was added (no old value was overwritten); otherwise false
.public boolean setOptionalStatisticEntry(String label)
StatisticOutput
setOptionalStatisticEntry
in interface StatisticOutput
label
- The entry's identifier.
true
, if a new statistic entry was added (no old value was overwritten); otherwise false
.protected Map<String,String> getOptionalEntries()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |