Package it.tidalwave.image.processor
Class Statistics
- java.lang.Object
-
- it.tidalwave.image.processor.Statistics
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<Statistics.Item>
public class Statistics extends java.lang.Object implements java.io.Serializable, java.lang.Iterable<Statistics.Item>
This class represents a set of statistics, that can be updated incrementally sample by sample. Each item has a name; min/max/avg values are recorded. It is mostly used for measuring execution time, but can be used for any value of typelong.- Author:
- Fabrizio Giudici
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStatistics.ItemThis class represents a single statistics item with name, min/max/avg value.
-
Constructor Summary
Constructors Constructor Description Statistics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSample(java.lang.String name, long value)Adds a new sample to these statistics.voiddump()voiddump(java.io.PrintWriter pw)java.util.Iterator<Statistics.Item>iterator()voidmerge(Statistics statistics)Merges these statistics with others.
-
-
-
Method Detail
-
addSample
public void addSample(java.lang.String name, long value)Adds a new sample to these statistics.- Parameters:
name- the namevalue- the value
-
merge
public void merge(Statistics statistics)
Merges these statistics with others.- Parameters:
statistics- the other statistics
-
dump
public void dump()
-
dump
public void dump(java.io.PrintWriter pw)
-
iterator
public java.util.Iterator<Statistics.Item> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<Statistics.Item>
-
-