/** * Creates a new instance of this class. * * @param maxIterations the maximum number of iterations * @param callBack the function to be called when the maximum number of * iterations has been reached * @throws org.apache.commons.math3.exception.NullArgumentException if {@code callBack} is {@code null} * @since 3.6 */ public IterationManager(final int maxIterations, final IntegerSequence.Incrementor.MaxCountExceededCallback callBack) { this.iterations = IntegerSequence.Incrementor.create().withMaximalCount(maxIterations).withCallback(callBack); this.listeners = new CopyOnWriteArrayList<IterationListener>(); }
/** * Creates a new instance of this class. * * @param maxIterations the maximum number of iterations * @param callBack the function to be called when the maximum number of * iterations has been reached * @throws org.apache.commons.math3.exception.NullArgumentException if {@code callBack} is {@code null} * @since 3.6 */ public IterationManager(final int maxIterations, final IntegerSequence.Incrementor.MaxCountExceededCallback callBack) { this.iterations = IntegerSequence.Incrementor.create().withMaximalCount(maxIterations).withCallback(callBack); this.listeners = new CopyOnWriteArrayList<IterationListener>(); }