/** * Adds one to the current iteration count. * At counter exhaustion, this method will call the * {@link MaxCountExceededCallback#trigger(int) trigger} method of the * callback object passed to the * {@link #Incrementor(int,MaxCountExceededCallback) constructor}. * If not explictly set, a default callback is used that will throw * a {@code MaxCountExceededException}. * * @throws MaxCountExceededException at counter exhaustion, unless a * custom {@link MaxCountExceededCallback callback} has been set at * construction. */ public void incrementCount() throws MaxCountExceededException { if (++count > maximalCount) { maxCountCallback.trigger(maximalCount); } }
/** * Adds one to the current iteration count. * At counter exhaustion, this method will call the * {@link MaxCountExceededCallback#trigger(int) trigger} method of the * callback object passed to the * {@link #Incrementor(int,MaxCountExceededCallback) constructor}. * If not explictly set, a default callback is used that will throw * a {@code MaxCountExceededException}. * * @throws MaxCountExceededException at counter exhaustion, unless a * custom {@link MaxCountExceededCallback callback} has been set at * construction. */ public void incrementCount() throws MaxCountExceededException { if (++count > maximalCount) { maxCountCallback.trigger(maximalCount); } }
/** {@inheritDoc} */ public void trigger(final int maximalCount) throws MaxCountExceededException { callBack.trigger(maximalCount); } });
/** * Adds one to the current iteration count. * At counter exhaustion, this method will call the * {@link MaxCountExceededCallback#trigger(int) trigger} method of the * callback object passed to the * {@link #Incrementor(int,MaxCountExceededCallback) constructor}. * If not explictly set, a default callback is used that will throw * a {@code MaxCountExceededException}. * * @throws MaxCountExceededException at counter exhaustion, unless a * custom {@link MaxCountExceededCallback callback} has been set at * construction. */ public void incrementCount() throws MaxCountExceededException { if (++count > maximalCount) { maxCountCallback.trigger(maximalCount); } }
/** {@inheritDoc} */ public void trigger(final int maximalCount) throws MaxCountExceededException { callBack.trigger(maximalCount); } });