Package it.tidalwave.image.processor
Class Statistics.Item
- java.lang.Object
-
- it.tidalwave.image.processor.Statistics.Item
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Statistics.Item>
- Enclosing class:
- Statistics
public static class Statistics.Item extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<Statistics.Item>
This class represents a single statistics item with name, min/max/avg value.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Item(java.lang.String name)Create a new sample.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSample(long value)Adds a new sample to this item.intcompareTo(Statistics.Item o)longgetAccumulator()longgetAverage()Returns the average value.longgetMaximum()Returns the maximum value.longgetMinimum()Returns the minimum value.java.lang.StringgetName()Returns the sample name.intgetSampleCount()protected voidmerge(Statistics.Item otherItem)Merges this item with another.java.lang.StringtoString()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the sample name.- Returns:
- the name
-
getMinimum
public long getMinimum()
Returns the minimum value.- Returns:
- the minimum value
-
getMaximum
public long getMaximum()
Returns the maximum value.- Returns:
- the maximum value
-
getAverage
public long getAverage()
Returns the average value.- Returns:
- the average value
-
getAccumulator
public long getAccumulator()
-
getSampleCount
public int getSampleCount()
-
addSample
public void addSample(long value)
Adds a new sample to this item.- Parameters:
value- the value
-
compareTo
public int compareTo(Statistics.Item o)
- Specified by:
compareToin interfacejava.lang.Comparable<Statistics.Item>
-
merge
protected void merge(Statistics.Item otherItem)
Merges this item with another.- Parameters:
otherItem- the other item
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-