/** * Defines an interface that keeps track of a statistic * about a stream of numbers. */ public interface Statistic { /** * Provide a name describing the statistic. * @return the name of this statistic */ String getName(); /** * Provide the current statistic value. * @return the current statistic value. */ double getValue(); /** * Update the statistic value given a new observation. * @param x a new observation */ void update(double x); }