Deprecated
Use IntegerSequence. instead.
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.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | Incrementor.
Defines a method to be called at counter exhaustion. |
| Modifier and Type | Field and Description |
|---|---|
| private int | count
Current count. |
| private final Incrementor. | maxCountCallback
Function called at counter exhaustion. |
| private int | maximalCount
Upper limit for the counter. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | Incrementor(int
Maximal count. max, Incrementor.Function to be called when the maximal count has been reached. cbDefines a maximal count and a callback method to be triggered at counter exhaustion. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: false if the next call to incrementCount will trigger a MaxCountExceededException,
true otherwise.Checks whether a single increment is allowed. |
| public int | |
| public int | |
| public void | |
| public void | |
| public void | |
| public void | |
| public static Incrementor | Returns: an incrementor wrapping anIntegerSequence.wrapped incrementorIntegerSequence.
Deprecated
as a consequence of
Incrementor being deprecated.
Create an instance that delegates everything to a |
| count | back to summary |
|---|---|
| private int count Current count. | |
| maxCountCallback | back to summary |
|---|---|
| private final Incrementor. Function called at counter exhaustion. | |
| maximalCount | back to summary |
|---|---|
| private int maximalCount Upper limit for the counter. | |
| Incrementor | back to summary |
|---|---|
| public Incrementor() Default constructor.
For the new instance to be useful, the maximal count must be set
by calling | |
| Incrementor | back to summary |
|---|---|
| public Incrementor(int max) Defines a maximal count.
| |
| Incrementor | back to summary |
|---|---|
| public Incrementor(int max, Incrementor. Defines a maximal count and a callback method to be triggered at counter exhaustion.
| |
| canIncrement | back to summary |
|---|---|
| public boolean canIncrement() Checks whether a single increment is allowed.
| |
| getCount | back to summary |
|---|---|
| public int getCount() Gets the current count.
| |
| getMaximalCount | back to summary |
|---|---|
| public int getMaximalCount() Gets the upper limit of the counter.
| |
| incrementCount | back to summary |
|---|---|
| public void incrementCount(int value) throws MaxCountExceededException Performs multiple increments.
See the other
| |
| incrementCount | back to summary |
|---|---|
| public void incrementCount() throws MaxCountExceededException Adds one to the current iteration count.
At counter exhaustion, this method will call the
| |
| resetCount | back to summary |
|---|---|
| public void resetCount() Resets the counter to 0. | |
| setMaximalCount | back to summary |
|---|---|
| public void setMaximalCount(int max) Sets the upper limit for the counter.
This does not automatically reset the current count to zero (see
| |
| wrap | back to summary |
|---|---|
| public static Incrementor wrap(final IntegerSequence. Deprecated as a consequence of Create an instance that delegates everything to a
This factory method is intended only as a temporary hack for internal use in
Apache Commons Math 3.X series, when
All methods are mirrored to the underlying
| |
trigger method should usually throw an exception.
| Modifier and Type | Method and Description |
|---|---|
| public void |
| trigger | back to summary |
|---|---|
| public void trigger(int maximalCount) throws MaxCountExceededException Function called when the maximal count has been reached.
| |