Class IdBlock


  • public final class IdBlock
    extends java.lang.Object
    A class representing an ID space.
    • Constructor Summary

      Constructors 
      Constructor Description
      IdBlock​(long start, long size)
      Constructs a new ID block with the specified size and initial value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getNextId()
      Returns the next ID in the block.
      long getSize()
      Returns the block size.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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:
        java.lang.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.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object