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 void
addSample(long value)
Adds a new sample to this item.int
compareTo(Statistics.Item o)
long
getAccumulator()
long
getAverage()
Returns the average value.long
getMaximum()
Returns the maximum value.long
getMinimum()
Returns the minimum value.java.lang.String
getName()
Returns the sample name.int
getSampleCount()
protected void
merge(Statistics.Item otherItem)
Merges this item with another.java.lang.String
toString()
-
-
-
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:
compareTo
in 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:
toString
in classjava.lang.Object
-
-