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 class
Statistics.Item
This 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 void
addSample(java.lang.String name, long value)
Adds a new sample to these statistics.void
dump()
void
dump(java.io.PrintWriter pw)
java.util.Iterator<Statistics.Item>
iterator()
void
merge(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:
iterator
in interfacejava.lang.Iterable<Statistics.Item>
-
-