Class IdBlock


  • public final class IdBlock
    extends Object
    A class representing an ID space.
    • Constructor Detail

      • IdBlock

        public IdBlock​(long start,
                       long size)
        Constructs a new ID block with the specified size and initial value.
        Parameters:
        start - initial value of the block
        size - size of the block
        Throws:
        IllegalArgumentException - if the size is less than or equal to 0
    • Method Detail

      • getSize

        public long getSize()
        Returns the block size.
        Returns:
        block size
      • getNextId

        public long getNextId()
        Returns the next ID in the block.
        Returns:
        next ID
        Throws:
        UnavailableIdException - if there is no available ID in the block.