org.apache.commons.math3.util
Class Incrementor

Utility that increments a counter until a maximum is reached, at
which point, the instance will by default throw a
MaxCountExceededException.
However, the user is able to override this behaviour by defining a
custom callback, in order to e.g.
select which exception must be thrown.

incrementCount

Adds one to the current iteration count.
At counter exhaustion, this method will call the
trigger method of the
callback object passed to the
constructor.
If not explictly set, a default callback is used that will throw
a MaxCountExceededException.