@CodeReview(reviewer="Kevin R. Dixon", date="2008-02-26", changesNeeded=false, comments={"Made some of the javadoc more descriptive","Otherwise, looks good."}) public class NumberAverager extends AbstractCloneableSerializable implements Summarizer<java.lang.Number,java.lang.Double>
Modifier and Type | Field and Description |
---|---|
static NumberAverager |
INSTANCE
Instance of NumberAverager, since it has no state.
|
Constructor and Description |
---|
NumberAverager()
Creates a new instance of NumberAverager
|
Modifier and Type | Method and Description |
---|---|
java.lang.Double |
summarize(java.util.Collection<? extends java.lang.Number> data)
Returns the average (arithmetic mean) of a Collection of Numbers,
or null if the collection of Numbers are null
|
clone
public static final NumberAverager INSTANCE
public java.lang.Double summarize(java.util.Collection<? extends java.lang.Number> data)
summarize
in interface Summarizer<java.lang.Number,java.lang.Double>
data
- Collection of Number to compute the average of