/** * {@inheritDoc} */ protected boolean update(Double sample) { if (isAccepted(sample)) { sum += sample; return true; } return false; }
/** * {@inheritDoc} */ public Double get(Statistic stat) { if (getNumAccepted() == 0) { return Double.NaN; } switch (stat) { case SUM: return sum; default: throw new IllegalArgumentException(stat + " not supported by " + getClass().getName()); } }