Package opennlp.tools.util.eval
Class Mean
- java.lang.Object
-
- opennlp.tools.util.eval.Mean
-
public class Mean extends java.lang.Object
Calculates the arithmetic mean of values added with theadd(double)
method.
-
-
Constructor Summary
Constructors Constructor Description Mean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(double value)
Adds a value to the arithmetic mean.void
add(double value, long count)
Adds a value count times to the arithmetic mean.long
count()
Retrieves the number of times a value was added to the mean.double
mean()
Retrieves the mean of all values added withadd(double)
or 0 if there are zero added values.java.lang.String
toString()
-
-
-
Method Detail
-
add
public void add(double value)
Adds a value to the arithmetic mean.- Parameters:
value
- the value which should be added to the arithmetic mean.
-
add
public void add(double value, long count)
Adds a value count times to the arithmetic mean.- Parameters:
value
- the value which should be added to the arithmetic mean.count
- number of times the value should be added to arithmetic mean.
-
mean
public double mean()
Retrieves the mean of all values added withadd(double)
or 0 if there are zero added values.
-
count
public long count()
Retrieves the number of times a value was added to the mean.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-