Class CachedAtomicInteger


  • public class CachedAtomicInteger
    extends java.lang.Object
    Uses an DistributedAtomicNumber and allocates values in chunks for better performance
    • Constructor Detail

      • CachedAtomicInteger

        public CachedAtomicInteger​(DistributedAtomicInteger number,
                                   int cacheFactor)
        Parameters:
        number - the number to use
        cacheFactor - the number of values to allocate at a time
    • Method Detail

      • next

        public AtomicValue<java.lang.Integer> next()
                                            throws java.lang.Exception
        Returns the next value (incrementing by 1). If a new chunk of numbers is needed, it is requested from the number
        Returns:
        next increment
        Throws:
        java.lang.Exception - errors