|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbcds.tools.stat.CollectorBase
public abstract class CollectorBase
Provides default implementation for classes implementing the
Collector
interface, as well as utility functions.
Constructor Summary | |
---|---|
CollectorBase()
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object b)
Twco Collectors are equal if their type and name match. |
java.lang.String |
getDescription()
Returns this collector's description. |
java.lang.String |
getName()
Returns this collector's name. |
int |
hashCode()
Returns this object's hash code. |
java.lang.String |
report()
Returns this collector's name followed by the a list of desciption=value for the results. |
static java.lang.String |
report(java.util.Collection<? extends Collector> collectors)
Returns a string, one line per collector, resulting from calling the report method on each object in the given collection. |
static java.lang.String |
report(java.lang.String collector_label,
java.util.Collection<? extends Collector> collectors)
Formats the results of a series of collectors belonging to the same class, one line per collector, and as many columns as results are provided by the class. |
void |
setup(java.lang.String name,
java.lang.String desc)
Resets this collector (the observation counter is set to 0). |
java.lang.String |
toString()
Returns this collector's name. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface bcds.tools.stat.Collector |
---|
collect, getResults, getResultsLabels |
Constructor Detail |
---|
public CollectorBase()
Method Detail |
---|
public void setup(java.lang.String name, java.lang.String desc)
setup
in interface Collector
public java.lang.String getName()
getName
in interface Collector
public java.lang.String getDescription()
getDescription
in interface Collector
public java.lang.String report()
Number of xyz average=1.3134 stddev=0.6 min=0.3 max=4.12 count=240
report
in interface Collector
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object b)
equals
in class java.lang.Object
public static java.lang.String report(java.lang.String collector_label, java.util.Collection<? extends Collector> collectors)
Example:
Variable |average|min |max ----------|-------|-----|----- Some var a|3.1234 |0.312|6.738 Some var b|nnn |yyy |www Some var c|nnn |yyyy |ww ...The format is tabular (values are vertically aligned with spaces, left-justified).
The parameter collector_label
may be null, in which case
the word "Variable" is used as label.
Collectors appear in the order in which they are returned by the collections' iterator.
If the result cannot be tabulated, indicated by the fact that
Collector.getResultsLabels()
return a zero-length array,
this method returns an empty string.
java.lang.IllegalArgumentException
- if the objects in
collectors
are not all of exactly the same class, or if the
results cannot be tabulated, indicated by the fact that
Collector.getResultsLabels()
return a zero-length array.public static java.lang.String report(java.util.Collection<? extends Collector> collectors)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |