Class IdentifierManager

java.lang.Object
org.apache.poi.ooxml.util.IdentifierManager

public class IdentifierManager extends Object

24.08.2009

Author:
Stefan Stern
  • Field Details

  • Constructor Details

    • IdentifierManager

      public IdentifierManager(long lowerbound, long upperbound)
      Parameters:
      lowerbound - the lower limit of the id-range to manage. Must be greater than or equal to MIN_ID.
      upperbound - the upper limit of the id-range to manage. Must be less then or equal MAX_ID.
  • Method Details

    • reserve

      public long reserve(long id)
    • reserveNew

      public long reserveNew()
      Returns:
      a new identifier.
      Throws:
      IllegalStateException - if no more identifiers are available, then an Exception is raised.
    • release

      public boolean release(long id)
      Parameters:
      id - the identifier to release. Must be greater than or equal to lowerbound and must be less than or equal to upperbound
      Returns:
      true, if the identifier was reserved and has been successfully released, false, if the identifier was not reserved.
    • getRemainingIdentifiers

      public long getRemainingIdentifiers()