Skip navigation links
com.streamscape.lib.numalloc

Class IntNumberAllocator

    • Constructor Detail

      • IntNumberAllocator

        public IntNumberAllocator()
        Constructs a new allocator.
      • IntNumberAllocator

        public IntNumberAllocator(long startNumber)
        Constructs a new allocator.
    • Method Detail

      • getNumber

        public int getNumber()
                      throws NumberAllocatorException
        Returns an available (non-assigned) number from the pool.
        Returns:
        the available number.
        Throws:
        NumberAllocatorException - if the pool does not contain available numbers.
      • releaseNumber

        public void releaseNumber(int number)
        Releases the specified number (returns this number back into the pool).
        Parameters:
        number - the released number.

Copyright © 2015-2024 StreamScape Technologies. All rights reserved.