public class Counter
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
Counter()
Construct a counter with no rounding.
|
Counter(int scale)
Construct a counter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(double... numbers)
Add numbers to the counter.
|
void |
add(double number)
Add a number to the counter.
|
int |
count(double number)
Get the count, i.e., the number of occurrences, of a particular number.
|
java.util.Set<java.lang.Double> |
keySet()
Get the set of numbers the counter has seen.
|
public Counter()
public Counter(int scale)
scale - a precision in terms of the number of decimal pointspublic void add(double number)
number - a doublepublic void add(double... numbers)
numbers - doublespublic int count(double number)
number - a numberpublic java.util.Set<java.lang.Double> keySet()