public class Counter extends Object
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.
|
Set<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 double
public void add(double... numbers)
numbers
- double
spublic int count(double number)
number
- a numberCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.