org.apache.poi.util
Class IdentifierManager
java.lang.Object
org.apache.poi.util.IdentifierManager
public class IdentifierManager
- extends java.lang.Object
24.08.2009
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_ID
public static final long MAX_ID
- See Also:
- Constant Field Values
MIN_ID
public static final long MIN_ID
- See Also:
- Constant Field Values
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
.
reserve
public long reserve(long id)
reserveNew
public long reserveNew()
- Returns:
- a new identifier.
- Throws:
java.lang.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()