Package dev.nm.stat.descriptive
Class SynchronizedStatistic
- java.lang.Object
-
- dev.nm.stat.descriptive.SynchronizedStatistic
-
- All Implemented Interfaces:
Statistic
public class SynchronizedStatistic extends Object implements Statistic
This is a thread-safe wrapper ofStatisticby synchronizing all public methods so that only one thread at a time can access the instance. This is essentially the same principle used by Java's synchronized collection class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddData(double... data)Recompute the statistic with more data, incrementally if possible.longN()Get the size of the sample.doublevalue()Get the value of the statistic.
-