Increment the stored value of the counter and return its new value.
Increment the stored value of the counter and return its new value.
inc
is the amount to increment by (default: 1).
Reset the value, by default to the initial value of the counter.
Return the current value of the counter.
Thread-safe counters. This class provides an operation that can be used to generate a sequence of integer values. Instances of this class are useful for generating things like unique names for generated entities. The methods synchronize on the counter value so they can be called safely from more than one thread.
init
is the initial value of the counter (default: -1).